[FFmpeg-cvslog] avformat/voc_packet: Add a basic check on max_size

Michael Niedermayer git at videolan.org
Mon Mar 1 21:20:21 EET 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Dec 12 01:24:42 2020 +0100| [52f75181bfada2b4b127e744674591c7753c4b7d] | committer: Michael Niedermayer

avformat/voc_packet: Add a basic check on max_size

Fixes: signed integer overflow: -2147483648 - 4 cannot be represented in type 'int'
Fixes: 28127/clusterfuzz-testcase-minimized-ffmpeg_dem_VOC_fuzzer-4880586455646208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/voc_packet.c b/libavformat/voc_packet.c
index 1e2e19e1c3..9d7d2025cd 100644
--- a/libavformat/voc_packet.c
+++ b/libavformat/voc_packet.c
@@ -44,6 +44,8 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
                        AVINDEX_KEYFRAME);
 
     while (!voc->remaining_size) {
+        if (max_size < 4)
+            max_size = 0;
         type = avio_r8(pb);
         if (type == VOC_TYPE_EOF)
             return AVERROR_EOF;



More information about the ffmpeg-cvslog mailing list