ffmpeg | branch: master | Jun Zhao <barryjz...@tencent.com> | Sat Sep 21 
19:29:47 2019 +0800| [333109f46961946d3c6fab05210a8d543697c91b] | committer: 
James Almer

lavc/mpeg4audio: add chan_config check to avoid indeterminate channels

add chan_config check to avoid indeterminate channels.

Signed-off-by: Jun Zhao <barryjz...@tencent.com>
Signed-off-by: James Almer <jamr...@gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=333109f46961946d3c6fab05210a8d543697c91b
---

 libavcodec/mpeg4audio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c
index 6962a42537..e4d6716f7f 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(logctx, 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 &&

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to