Avoid a failed assert on invalid channel indices

Fixes: 14914/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-6288430994030592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
This commit is contained in:
Martin Storsjo 2019-08-15 13:12:57 +03:00
parent 4edc5c4808
commit 9b0f848911
1 changed files with 3 additions and 0 deletions

View File

@ -583,6 +583,9 @@ static PCMDMX_ERROR getChannelMode(
(channelType[ch] & 0x0F) - 1,
0); /* Assign all undefined channels (ACT_NONE) to front channels. */
if (channelIndices[ch] >= numCh[channelType[ch] >> 4][chGrp])
return PCMDMX_INVALID_CH_CONFIG;
spkrPos[ch] = getSpeakerPos(channelType[ch], channelIndices[ch],
numCh[channelType[ch] >> 4][chGrp]);