FreeCalypso > hg > fc-tourmaline
comparison src/cs/services/etm/etm_audio.c @ 283:d9e3f3e293ac
etm_audio.c: fix off-by-one error in auw of FIR coefficients
The implementation of auw operation for UL or DL FIR upload
had this bug: the number of 16-bit shortwords copied into the
RVF-allocated temporary buffer was one too many, causing memory
corruption errors. The present change fixes this bug.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 08 Nov 2021 02:54:04 +0000 |
parents | 4e78acac3d88 |
children |
comparison
equal
deleted
inserted
replaced
282:231bceb7d95c | 283:d9e3f3e293ac |
---|---|
222 tr_etm(TgTrAudio, "ETM AUDIO: _audio_write: AUDIO_MICROPHONE/SPEAKER_FIR [%d]", | 222 tr_etm(TgTrAudio, "ETM AUDIO: _audio_write: AUDIO_MICROPHONE/SPEAKER_FIR [%d]", |
223 sizeof(T_AUDIO_FIR_COEF)/2); // RemoveMe | 223 sizeof(T_AUDIO_FIR_COEF)/2); // RemoveMe |
224 | 224 |
225 parameter = etm_malloc (sizeof(T_AUDIO_FIR_COEF)); | 225 parameter = etm_malloc (sizeof(T_AUDIO_FIR_COEF)); |
226 // Write coeffient values | 226 // Write coeffient values |
227 for (i=0; i <= (sizeof(T_AUDIO_FIR_COEF)/2); i++) { | 227 for (i=0; i < (sizeof(T_AUDIO_FIR_COEF)/2); i++) { |
228 ((T_AUDIO_FIR_COEF *) parameter)->coefficient[i] = etm_get16(buf); buf += 2; | 228 ((T_AUDIO_FIR_COEF *) parameter)->coefficient[i] = etm_get16(buf); buf += 2; |
229 } | 229 } |
230 audio.data = parameter; | 230 audio.data = parameter; |
231 break; | 231 break; |
232 } | 232 } |