[FFmpeg-cvslog] avformat/mvdec: Check bytes_per_sample

Michael Niedermayer git at videolan.org
Sat Dec 25 13:00:15 EET 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Dec 23 20:43:47 2021 +0100| [f3a949dc4c6f01f43d502cbe2a7c06fe95114c79] | committer: Michael Niedermayer

avformat/mvdec: Check bytes_per_sample

Fixes: division by zero
Fixes: 42814/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4787014237552640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross at xvid.org>
Reviewed-by: John-Paul Stewart <jpstewart at personalprojects.net>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/mvdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index 1a5012e507..ea955d2b11 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -366,6 +366,9 @@ static int mv_read_header(AVFormatContext *avctx)
             avpriv_request_sample(avctx, "Audio compression (format %i)", v);
         }
 
+        if (bytes_per_sample == 0)
+            return AVERROR_INVALIDDATA;
+
         if (set_channels(avctx, ast, avio_rb32(pb)) < 0)
             return AVERROR_INVALIDDATA;
 



More information about the ffmpeg-cvslog mailing list