diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-08-09 17:06:37 +0200 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2019-10-10 12:42:13 -0700 |
commit | 128abf6b1ace9c790ba7f42d976d3035cbe347b6 (patch) | |
tree | cae05ddb22f94793177254532b5ddf687073dac7 | |
parent | dbfa1cd71bbc5c0af382f47c222a72739bc101de (diff) | |
download | fdk-aac-128abf6b1ace9c790ba7f42d976d3035cbe347b6.tar.gz fdk-aac-128abf6b1ace9c790ba7f42d976d3035cbe347b6.tar.bz2 fdk-aac-128abf6b1ace9c790ba7f42d976d3035cbe347b6.zip |
Validate aacSampleRate after applying ELD downscale factor. Avoid division by zero.
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I3f7ece9451121d40fab2c97571c695c1ac62bd00
-rw-r--r-- | libAACdec/src/aacdecoder.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp index 7617937..38ef4f8 100644 --- a/libAACdec/src/aacdecoder.cpp +++ b/libAACdec/src/aacdecoder.cpp @@ -1928,6 +1928,9 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc, self->samplingRateInfo[0].samplingRate / self->downscaleFactor; self->streamInfo.aacSamplesPerFrame = asc->m_samplesPerFrame / self->downscaleFactor; + if (self->streamInfo.aacSampleRate <= 0) { + return AAC_DEC_UNSUPPORTED_SAMPLINGRATE; + } } } |