]> Repos - portaudio/commitdiff
Don't crash for alsa_snd_pcm_poll_descriptors fail in another case
authorDaniel Schürmann <daschuer@mixxx.org>
Mon, 14 Dec 2020 07:03:04 +0000 (08:03 +0100)
committerDaniel Schürmann <daschuer@mixxx.org>
Mon, 14 Dec 2020 07:03:04 +0000 (08:03 +0100)
src/hostapi/alsa/pa_linux_alsa.c

index 05643510ea51344a22626616e0eb9255a0536adf..22c30f194ed8c81a43ad00927dc0e03eab7fcaa2 100644 (file)
@@ -3805,14 +3805,19 @@ static PaError PaAlsaStream_WaitForFrames( PaAlsaStream *self, unsigned long *fr
         if( pollCapture )
         {
             capturePfds = self->pfds;
-            PA_ENSURE( PaAlsaStreamComponent_BeginPolling( &self->capture, capturePfds ) );
+            PaError res = PaAlsaStreamComponent_BeginPolling( &self->capture, capturePfds );
+            if( res != paNoError)
+            {
+              xrun = 1;
+              goto end;
+            }
             totalFds += self->capture.nfds;
         }
         if( pollPlayback )
         {
             /* self->pfds is in effect an array of fds; if necessary, index past the capture fds */
             playbackPfds = self->pfds + (pollCapture ? self->capture.nfds : 0);
-            int res = PaAlsaStreamComponent_BeginPolling( &self->playback, playbackPfds );
+            PaError res = PaAlsaStreamComponent_BeginPolling( &self->playback, playbackPfds );
             if( res != paNoError)
             {
               xrun = 1;