Don't crash for alsa_snd_pcm_poll_descriptors fail in another case

This commit is contained in:
Daniel Schürmann 2020-12-14 08:03:04 +01:00
commit 8f63b51808

View 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;