1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-02-17 03:30:35 +01:00

Add sampling rate sanity check

am: ba00378577

Change-Id: I9173c64ea2386a987aa563fc89bdaa7652f649b0
This commit is contained in:
Fraunhofer IIS FDK 2018-09-06 13:21:58 -07:00 committed by android-build-merger
commit 4d1f3e3cfb

View File

@ -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;
}