aboutsummaryrefslogtreecommitdiffstats
path: root/libMpegTPDec/src/tpdec_asc.cpp
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-06-29 16:35:24 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-09-10 23:19:14 +0000
commitc2208f2a3098410c5a4c79ad6bd4b6d7e1c0b03f (patch)
treeb86c196d8eb8a673c876ce9173fbf150cc503753 /libMpegTPDec/src/tpdec_asc.cpp
parentf19e863cce96cc1e5f4ad7ce512810d5a2843ea6 (diff)
downloadfdk-aac-c2208f2a3098410c5a4c79ad6bd4b6d7e1c0b03f.tar.gz
fdk-aac-c2208f2a3098410c5a4c79ad6bd4b6d7e1c0b03f.tar.bz2
fdk-aac-c2208f2a3098410c5a4c79ad6bd4b6d7e1c0b03f.zip
Add sampling rate sanity check
Bug: 112661641 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I8e416fb1501dabda20babd4a28a99ab06950b221 (cherry picked from commit ba003785774efe355bcac950158fc78a0cff0c2b)
Diffstat (limited to 'libMpegTPDec/src/tpdec_asc.cpp')
-rw-r--r--libMpegTPDec/src/tpdec_asc.cpp4
1 files changed, 3 insertions, 1 deletions
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;
}