Skip to content

Commit 88aa0cb

Browse files
added && pData->codecStatus == CODEC_STATUS_INITIALISED checks for possibly unallocated memory
1 parent 18fd5ab commit 88aa0cb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

examples/src/decorrelator/decorrelator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void decorrelator_init
105105
/* define frequency vector */
106106
pData->fs = sampleRate;
107107
afSTFT_getCentreFreqs(pData->hSTFT, (float)sampleRate, HYBRID_BANDS, pData->freqVector);
108-
if(pData->hDecor!=NULL)
108+
if(pData->hDecor!=NULL && pData->codecStatus == CODEC_STATUS_INITIALISED)
109109
latticeDecorrelator_reset(pData->hDecor);
110110
}
111111

examples/src/powermap/powermap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void powermap_init
150150

151151
/* intialise parameters */
152152
memset(pData->Cx, 0 , MAX_NUM_SH_SIGNALS*MAX_NUM_SH_SIGNALS*HYBRID_BANDS*sizeof(float_complex));
153-
if(pData->prev_pmap!=NULL)
153+
if(pData->prev_pmap!=NULL && pData->codecStatus == CODEC_STATUS_INITIALISED)
154154
memset(pData->prev_pmap, 0, pars->grid_nDirs*sizeof(float));
155155
pData->pmapReady = 0;
156156
pData->dispSlotIdx = 0;

0 commit comments

Comments
 (0)