From 128abf6b1ace9c790ba7f42d976d3035cbe347b6 Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Fri, 9 Aug 2019 17:06:37 +0200 Subject: Validate aacSampleRate after applying ELD downscale factor. Avoid division by zero. Bug: 131430997 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I3f7ece9451121d40fab2c97571c695c1ac62bd00 --- libAACdec/src/aacdecoder.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libAACdec/src/aacdecoder.cpp') 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; + } } } -- cgit v1.2.3