From: richard_ash Date: Fri, 12 Nov 2010 17:16:21 +0000 (+0000) Subject: Commit fix for crash during full-duplex operation with PulseAudio. Reported by Al... X-Git-Tag: pa_stable_v19_20110326_r1647~76 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=148784f3c73ee9747ecbff578984c1f1dcedbe3d;p=portaudio Commit fix for crash during full-duplex operation with PulseAudio. Reported by Al Dimond, fix proposed by Ross Bencina, acked by Dmitry Kostjuchenko. This fixes a bug with Dmitry's zero-copy optimisations. Fix works in Audacity (where the bug was found), so comitting upstream. --- diff --git a/src/common/pa_process.c b/src/common/pa_process.c index 01a9ee2..3830532 100644 --- a/src/common/pa_process.c +++ b/src/common/pa_process.c @@ -764,7 +764,7 @@ static unsigned long NonAdaptingProcess( PaUtilBufferProcessor *bp, destChannelStrideBytes = bp->bytesPerUserInputSample; /* process host buffer directly, or use temp buffer if formats differ or host buffer non-interleaved */ - if( bp->userInputSampleFormatIsEqualToHost && bp->hostInputIsInterleaved ) + if( bp->userInputSampleFormatIsEqualToHost && bp->hostInputIsInterleaved && bp->hostInputChannels[0][0].data) { userInput = hostInputChannels[0].data; destBytePtr = (unsigned char *)hostInputChannels[0].data; @@ -781,7 +781,7 @@ static unsigned long NonAdaptingProcess( PaUtilBufferProcessor *bp, destChannelStrideBytes = frameCount * bp->bytesPerUserInputSample; /* setup non-interleaved ptrs */ - if( bp->userInputSampleFormatIsEqualToHost && !bp->hostInputIsInterleaved ) + if( bp->userInputSampleFormatIsEqualToHost && !bp->hostInputIsInterleaved && bp->hostInputChannels[0][0].data ) { for( i=0; iinputChannelCount; ++i ) {