ffmpeg | branch: release/4.3 | Michael Niedermayer <mich...@niedermayer.cc> | 
Mon Feb  8 14:29:01 2021 +0100| [f678e8196c32c4678f942bf8d8f928a8aed0eed7] | 
committer: Michael Niedermayer

avformat/wtvdec: Check len in parse_chunks() to avoid overflow

Fixes: signed integer overflow: 2147483647 + 7 cannot be represented in type 
'int'
Fixes: 
30084/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6192261941559296

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pr...@xvid.org>
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit 5552ceaf568915e668679f9581e07eb5507cafc4)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

 libavformat/wtvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 77908e6392..aa6ff78c4b 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -794,7 +794,7 @@ static int parse_chunks(AVFormatContext *s, int mode, 
int64_t seekts, int *len_p
 
         ff_get_guid(pb, &g);
         len = avio_rl32(pb);
-        if (len < 32) {
+        if (len < 32 || len > INT_MAX - 7) {
             int ret;
             if (avio_feof(pb))
                 return AVERROR_EOF;

_______________________________________________
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