[FFmpeg-cvslog] avformat/rmdec: check tag_size

Michael Niedermayer git at videolan.org
Sun Oct 9 23:07:56 EEST 2022


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep 18 15:06:25 2022 +0200| [0a5e3c39eb14003b831d2796a816fed97de3f029] | committer: Michael Niedermayer

avformat/rmdec: check tag_size

Fixes: signed integer overflow: -2147483648 - 8 cannot be represented in type 'int'
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-6598073725353984

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 2cb7ee8a36bddd3425897135db514ca62fec6e44)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 098e299e6c..34a5923ce9 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -564,6 +564,8 @@ static int rm_read_header(AVFormatContext *s)
     }
 
     tag_size = avio_rb32(pb);
+    if (tag_size < 0)
+        return AVERROR_INVALIDDATA;
     avio_skip(pb, tag_size - 8);
 
     for(;;) {



More information about the ffmpeg-cvslog mailing list