aboutsummaryrefslogtreecommitdiffstats
path: root/libPCMutils/src/pcmdmx_lib.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2019-08-15 13:12:57 +0300
committerMartin Storsjo <martin@martin.st>2019-08-15 13:14:40 +0300
commit9b0f848911068943bbadeb37c0b8857605e74093 (patch)
tree6a944f6615069a2995327be87c838ba0ca3611cc /libPCMutils/src/pcmdmx_lib.cpp
parent4edc5c4808c2a21e6dc8dc6c8d5a00290d042528 (diff)
downloadfdk-aac-9b0f848911068943bbadeb37c0b8857605e74093.tar.gz
fdk-aac-9b0f848911068943bbadeb37c0b8857605e74093.tar.bz2
fdk-aac-9b0f848911068943bbadeb37c0b8857605e74093.zip
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
Diffstat (limited to 'libPCMutils/src/pcmdmx_lib.cpp')
-rw-r--r--libPCMutils/src/pcmdmx_lib.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libPCMutils/src/pcmdmx_lib.cpp b/libPCMutils/src/pcmdmx_lib.cpp
index 2070dbc..e3c3fa9 100644
--- a/libPCMutils/src/pcmdmx_lib.cpp
+++ b/libPCMutils/src/pcmdmx_lib.cpp
@@ -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]);