aboutsummaryrefslogtreecommitdiffstats
path: root/libMpegTPDec
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-06-29 16:35:24 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2018-09-05 14:05:32 -0700
commitba003785774efe355bcac950158fc78a0cff0c2b (patch)
treeb86c196d8eb8a673c876ce9173fbf150cc503753 /libMpegTPDec
parentf19e863cce96cc1e5f4ad7ce512810d5a2843ea6 (diff)
downloadfdk-aac-ba003785774efe355bcac950158fc78a0cff0c2b.tar.gz
fdk-aac-ba003785774efe355bcac950158fc78a0cff0c2b.tar.bz2
fdk-aac-ba003785774efe355bcac950158fc78a0cff0c2b.zip
Add sampling rate sanity check
Bug: 112661641 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I8e416fb1501dabda20babd4a28a99ab06950b221
Diffstat (limited to 'libMpegTPDec')
-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;
}