Add sampling rate sanity check

Bug: 112661641
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I8e416fb1501dabda20babd4a28a99ab06950b221
This commit is contained in:
Fraunhofer IIS FDK 2018-06-29 16:35:24 +02:00 committed by Jean-Michel Trivi
parent f19e863cce
commit ba00378577
1 changed files with 3 additions and 1 deletions

View File

@ -2102,7 +2102,9 @@ TRANSPORTDEC_ERROR AudioSpecificConfig_Parse(
self->m_aot = getAOT(bs); self->m_aot = getAOT(bs);
self->m_samplingFrequency = self->m_samplingFrequency =
getSampleRate(bs, &self->m_samplingFrequencyIndex, 4); 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; return TRANSPORTDEC_PARSE_ERROR;
} }