From c2208f2a3098410c5a4c79ad6bd4b6d7e1c0b03f Mon Sep 17 00:00:00 2001 From: Fraunhofer IIS FDK Date: Fri, 29 Jun 2018 16:35:24 +0200 Subject: Add sampling rate sanity check Bug: 112661641 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I8e416fb1501dabda20babd4a28a99ab06950b221 (cherry picked from commit ba003785774efe355bcac950158fc78a0cff0c2b) --- libMpegTPDec/src/tpdec_asc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libMpegTPDec/src/tpdec_asc.cpp') diff --git a/libMpegTPDec/src/tpdec_asc.cpp b/libMpegTPDec/src/tpdec_asc.cpp index b0f1c6a..8d411e8 100644 --- a/libMpegTPDec/src/tpdec_asc.cpp +++ b/libMpegTPDec/src/tpdec_asc.cpp @@ -2102,7 +2102,9 @@ TRANSPORTDEC_ERROR AudioSpecificConfig_Parse( self->m_aot = getAOT(bs); self->m_samplingFrequency = getSampleRate(bs, &self->m_samplingFrequencyIndex, 4); - if (self->m_samplingFrequency <= 0) { + if (self->m_samplingFrequency <= 0 || + (self->m_samplingFrequency > 96000 && self->m_aot != 39) || + self->m_samplingFrequency > 4 * 96000) { return TRANSPORTDEC_PARSE_ERROR; } -- cgit v1.2.3