From 921891bbf114b8cdc1eecbb78fbfd34d5a7b30a0 Mon Sep 17 00:00:00 2001 From: Kevin Larke Date: Mon, 11 Aug 2014 11:43:11 -0700 Subject: [PATCH] cmProc4.c : cmRecdPlayExec() now checks for NULL inputs and outputs. --- cmProc4.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/cmProc4.c b/cmProc4.c index 1e1f775..c570ce8 100644 --- a/cmProc4.c +++ b/cmProc4.c @@ -4492,7 +4492,10 @@ cmRC_t cmRecdPlayExec( cmRecdPlay* p, const cmSample_t** iChs, cmSample_ // copy first block to end of LA buffer for(i=0; ilaChs[i]+p->laSmpIdx,n0,iChs[i] + srcOffs); + if( iChs[i] == NULL ) + cmVOS_Zero(p->laChs[i]+p->laSmpIdx,n0); + else + cmVOS_Copy(p->laChs[i]+p->laSmpIdx,n0,iChs[i] + srcOffs); p->laSmpIdx += n0; @@ -4500,7 +4503,10 @@ cmRC_t cmRecdPlayExec( cmRecdPlay* p, const cmSample_t** iChs, cmSample_ { // copy second block to begin of LA buffer for(i=0; ilaChs[i],n1,iChs[i] + srcOffs + n0); + if( iChs[i] == NULL ) + cmVOS_Zero(p->laChs[i],n1); + else + cmVOS_Copy(p->laChs[i],n1,iChs[i] + srcOffs + n0); p->laSmpIdx = n1; @@ -4517,7 +4523,10 @@ cmRC_t cmRecdPlayExec( cmRecdPlay* p, const cmSample_t** iChs, cmSample_ unsigned n = cmMin(fp->allocCnt - fp->recdIdx,smpCnt); unsigned i; for(i=0; ichCnt; ++i) - cmVOS_Copy(fp->chArray[i] + fp->recdIdx, n, iChs[i] ); + if( iChs[i] == NULL ) + cmVOS_Zero(fp->chArray[i] + fp->recdIdx, n ); + else + cmVOS_Copy(fp->chArray[i] + fp->recdIdx, n, iChs[i] ); fp->recdIdx += n; @@ -4536,7 +4545,8 @@ cmRC_t cmRecdPlayExec( cmRecdPlay* p, const cmSample_t** iChs, cmSample_ unsigned i; for(i=0; ichCnt; ++i) - cmVOS_MultVVS(oChs[i],n,fp->chArray[i] + fp->playIdx,gain); + if( oChs[i] != NULL ) + cmVOS_MultVVS(oChs[i],n,fp->chArray[i] + fp->playIdx,gain); fp->playIdx += n;