From bd021e7fb414744d47d48af1996b08ee2dc24a9c Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Fri, 17 Apr 2020 15:09:22 +0200 Subject: [PATCH] Fix wrong input buffer feed for PS encoder at less input samples than framesize. Bug 177604812 Test: see PS/SBR encoder Change-Id: I08a20209bcb83784fda5c14584b6e99c65672545 --- libAACenc/src/aacenc_lib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp index b0d0454..3bfdfe8 100644 --- a/libAACenc/src/aacenc_lib.cpp +++ b/libAACenc/src/aacenc_lib.cpp @@ -1784,8 +1784,8 @@ AACENC_ERROR aacEncEncode(const HANDLE_AACENCODER hAacEncoder, hAacEncoder->nSamplesRead)); INT_PCM *pIn = hAacEncoder->inputBuffer + - (hAacEncoder->inputBufferOffset + hAacEncoder->nSamplesRead) / - hAacEncoder->aacConfig.nChannels; + hAacEncoder->inputBufferOffset / hAacEncoder->aacConfig.nChannels + + hAacEncoder->nSamplesRead / hAacEncoder->extParam.nChannels; newSamples -= (newSamples % hAacEncoder->extParam