diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 0000000..8c5eac7 --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,25 @@ +name: SpellCheck + +on: + workflow_dispatch: + push: + branches: [ main ] + pull_request: + branches: [ main, 'v[0-9]+.[0-9]+' ] + +jobs: + markdown: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install CSpell + run: npm install -g cspell + + - name: Run CSpell + run: cspell --config resources/.lint/spell-check/.cspell.json "**/*" diff --git a/project/src/pv_speaker.c b/project/src/pv_speaker.c index ed2de08..043be30 100644 --- a/project/src/pv_speaker.c +++ b/project/src/pv_speaker.c @@ -150,6 +150,10 @@ PV_API pv_speaker_status_t pv_speaker_init( return PV_SPEAKER_STATUS_RUNTIME_ERROR; } } + if (count == 0) { + pv_speaker_delete(o); + return PV_SPEAKER_STATUS_RUNTIME_ERROR; + } if (device_index >= count) { pv_speaker_delete(o); return PV_SPEAKER_STATUS_INVALID_ARGUMENT;