aboutsummaryrefslogtreecommitdiffstats
path: root/libPCMutils
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2021-02-04 14:04:55 +0200
committerMartin Storsjo <martin@martin.st>2021-02-04 14:05:43 +0200
commit6a2eb8b30f4a65d3b9b0422bf14eaf7007149ffd (patch)
tree30b06fdecdbc93854c4cbc3089dbe733dcc42a07 /libPCMutils
parent77ee4dd31e8812a589e03f03347f592ef8260f4f (diff)
downloadfdk-aac-6a2eb8b30f4a65d3b9b0422bf14eaf7007149ffd.tar.gz
fdk-aac-6a2eb8b30f4a65d3b9b0422bf14eaf7007149ffd.tar.bz2
fdk-aac-6a2eb8b30f4a65d3b9b0422bf14eaf7007149ffd.zip
Avoid failing asserts on broken bitstreams
Fixes: 29712/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-5347313432264704 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Diffstat (limited to 'libPCMutils')
-rw-r--r--libPCMutils/src/pcmdmx_lib.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libPCMutils/src/pcmdmx_lib.cpp b/libPCMutils/src/pcmdmx_lib.cpp
index 2070dbc..534acad 100644
--- a/libPCMutils/src/pcmdmx_lib.cpp
+++ b/libPCMutils/src/pcmdmx_lib.cpp
@@ -583,6 +583,8 @@ 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]);