[FFmpeg-cvslog] avcodec/vmixdec: Check for end of input in decode_dcac()

Michael Niedermayer git at videolan.org
Fri Sep 8 03:30:35 EEST 2023


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Jul 23 18:48:54 2023 +0200| [d5cc9d8dd9eb592f9467a614ef28e6d5c5381e7c] | committer: Michael Niedermayer

avcodec/vmixdec: Check for end of input in decode_dcac()

Fixes: Timeout
Fixes: 59952/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-6718213736759296

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=d5cc9d8dd9eb592f9467a614ef28e6d5c5381e7c
---

 libavcodec/vmixdec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/vmixdec.c b/libavcodec/vmixdec.c
index b77c90929a..4cc5963e25 100644
--- a/libavcodec/vmixdec.c
+++ b/libavcodec/vmixdec.c
@@ -115,6 +115,8 @@ static int decode_dcac(AVCodecContext *avctx,
             if (dc_run > 0) {
                 dc_run--;
             } else {
+                if (get_bits_left(dc_gb) < 1)
+                    return AVERROR_INVALIDDATA;
                 dc_v = get_se_golomb_vmix(dc_gb);
                 dc += (unsigned)dc_v;
                 if (!dc_v)
@@ -127,6 +129,8 @@ static int decode_dcac(AVCodecContext *avctx,
                     continue;
                 }
 
+                if (get_bits_left(ac_gb) < 1)
+                    return AVERROR_INVALIDDATA;
                 ac_v = get_se_golomb_vmix(ac_gb);
                 i = scan[n];
                 block[i] = ((unsigned)ac_v * factors[i]) >> 4;



More information about the ffmpeg-cvslog mailing list