[FFmpeg-cvslog] oavformat/avidec: Check offset in odml

Michael Niedermayer git at videolan.org
Sat Oct 9 19:37:26 EEST 2021


ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep 19 21:51:28 2021 +0200| [afe2a1a8c52d880f4862aa278a2c98b7f16c9fa7] | committer: Michael Niedermayer

oavformat/avidec: Check offset in odml

Fixes: signed integer overflow: 9223372036854775807 + 8 cannot be represented in type 'long'
Fixes: 38787/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-4859845799444480

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

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

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

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index eb7353ddba..b15aa6ecdb 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -236,7 +236,7 @@ static int read_odml_index(AVFormatContext *s, int64_t frame_num)
             avio_rl32(pb);       /* size */
             duration = avio_rl32(pb);
 
-            if (avio_feof(pb))
+            if (avio_feof(pb) || offset > INT64_MAX - 8)
                 return AVERROR_INVALIDDATA;
 
             pos = avio_tell(pb);



More information about the ffmpeg-cvslog mailing list