aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2019-09-21 19:29:47 +0800
committerJames Almer <jamrial@gmail.com>2019-09-27 22:28:16 -0300
commit61853f7503530ae11ed407a80463dc7ac2e7362d (patch)
treec6539d0641a5b879c672025c10a2960f4315cae4
parent2ec1b096b10319120795d8f9c7ff9dafd92d3a3d (diff)
downloadffmpeg-61853f7503530ae11ed407a80463dc7ac2e7362d.tar.gz
lavc/mpeg4audio: add chan_config check to avoid indeterminate channels
add chan_config check to avoid indeterminate channels. Signed-off-by: Jun Zhao <barryjzhao@tencent.com> Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 333109f46961946d3c6fab05210a8d543697c91b)
-rw-r--r--libavcodec/mpeg4audio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c
index 219714752f..2dbd972eaf 100644
--- a/libavcodec/mpeg4audio.c
+++ b/libavcodec/mpeg4audio.c
@@ -93,6 +93,10 @@ int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c, GetBitContext *gb,
c->chan_config = get_bits(gb, 4);
if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
c->channels = ff_mpeg4audio_channels[c->chan_config];
+ else {
+ av_log(NULL, AV_LOG_ERROR, "Invalid chan_config %d\n", c->chan_config);
+ return AVERROR_INVALIDDATA;
+ }
c->sbr = -1;
c->ps = -1;
if (c->object_type == AOT_SBR || (c->object_type == AOT_PS &&