cmProc4.c : cmRecdPlayExec() now checks for NULL inputs and outputs.

This commit is contained in:
Kevin Larke 2014-08-11 11:43:11 -07:00
parent 634225d803
commit 921891bbf1

View File

@ -4492,6 +4492,9 @@ cmRC_t cmRecdPlayExec( cmRecdPlay* p, const cmSample_t** iChs, cmSample_
// copy first block to end of LA buffer
for(i=0; i<chCnt; ++i)
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,6 +4503,9 @@ cmRC_t cmRecdPlayExec( cmRecdPlay* p, const cmSample_t** iChs, cmSample_
{
// copy second block to begin of LA buffer
for(i=0; i<chCnt; ++i)
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,6 +4523,9 @@ cmRC_t cmRecdPlayExec( cmRecdPlay* p, const cmSample_t** iChs, cmSample_
unsigned n = cmMin(fp->allocCnt - fp->recdIdx,smpCnt);
unsigned i;
for(i=0; i<p->chCnt; ++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,6 +4545,7 @@ cmRC_t cmRecdPlayExec( cmRecdPlay* p, const cmSample_t** iChs, cmSample_
unsigned i;
for(i=0; i<p->chCnt; ++i)
if( oChs[i] != NULL )
cmVOS_MultVVS(oChs[i],n,fp->chArray[i] + fp->playIdx,gain);
fp->playIdx += n;