aboutsummaryrefslogtreecommitdiffstats
path: root/libAACenc/src/aacenc_lib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libAACenc/src/aacenc_lib.cpp')
-rw-r--r--libAACenc/src/aacenc_lib.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp
index 19546fc..caa62c5 100644
--- a/libAACenc/src/aacenc_lib.cpp
+++ b/libAACenc/src/aacenc_lib.cpp
@@ -1827,12 +1827,13 @@ AACENC_ERROR aacEncEncode(const HANDLE_AACENCODER hAacEncoder,
/* clear out until end-of-buffer */
if (nZeros) {
+ INT_PCM *pIn =
+ hAacEncoder->inputBuffer +
+ hAacEncoder->inputBufferOffset /
+ hAacEncoder->aacConfig.nChannels +
+ hAacEncoder->nSamplesRead / hAacEncoder->extParam.nChannels;
for (i = 0; i < (int)hAacEncoder->extParam.nChannels; i++) {
- FDKmemclear(hAacEncoder->inputBuffer +
- i * hAacEncoder->inputBufferSizePerChannel +
- (hAacEncoder->inputBufferOffset +
- hAacEncoder->nSamplesRead) /
- hAacEncoder->extParam.nChannels,
+ FDKmemclear(pIn + i * hAacEncoder->inputBufferSizePerChannel,
sizeof(INT_PCM) * nZeros);
}
hAacEncoder->nZerosAppended += nZeros;