ffmpeg | branch: release/4.4 | Michael Niedermayer <mich...@niedermayer.cc> | 
Sun Apr 25 19:54:19 2021 +0200| [704e4b8213c9064afb07f83ba85453b40114cb6c] | 
committer: Michael Niedermayer

avformat/msf: Check that channels doesnt overflow during extradata construction

Fixes: signed integer overflow: 2048 * 1122336 cannot be represented in type 
'int'
Fixes: 
29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MSF_fuzzer-6726959600107520

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit a1a277926b49dad60d9e78c6c7a8c6b5d0d6d7c9)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

 libavformat/msf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/msf.c b/libavformat/msf.c
index 155f488e44..1eaed54357 100644
--- a/libavformat/msf.c
+++ b/libavformat/msf.c
@@ -70,6 +70,8 @@ static int msf_read_header(AVFormatContext *s)
     case 4:
     case 5:
     case 6: st->codecpar->block_align = (codec == 4 ? 96 : codec == 5 ? 152 : 
192) * st->codecpar->channels;
+            if (st->codecpar->channels > UINT16_MAX / 2048)
+                return AVERROR_INVALIDDATA;
             ret = ff_alloc_extradata(st->codecpar, 14);
             if (ret < 0)
                 return ret;

_______________________________________________
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