diff mbox series

[FFmpeg-devel,2/2] avcodec/mv30: check mode_size vs. input space

Message ID 20200613200345.26762-2-michael@niedermayer.cc
State Accepted
Commit 75e2ac4f0752649a0b9486e6825ef68341ee974d
Headers show
Series [FFmpeg-devel,1/2] avcodec/ffwavesynth: Avoid undefined operation on ts overflow
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Michael Niedermayer June 13, 2020, 8:03 p.m. UTC
Fixes: Timeout (longer than my patience vs 1sec)
Fixes: 22984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5630021988515840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/mv30.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer June 14, 2020, 5:20 p.m. UTC | #1
On Sat, Jun 13, 2020 at 10:03:45PM +0200, Michael Niedermayer wrote:
> Fixes: Timeout (longer than my patience vs 1sec)
> Fixes: 22984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5630021988515840
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/mv30.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]
diff mbox series

Patch

diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c
index 013a5753fe..76b9170eaf 100644
--- a/libavcodec/mv30.c
+++ b/libavcodec/mv30.c
@@ -410,6 +410,9 @@  static int decode_intra(AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame
     int ret;
 
     mgb = *gb;
+    if (get_bits_left(gb) < s->mode_size * 8)
+        return AVERROR_INVALIDDATA;
+
     skip_bits_long(gb, s->mode_size * 8);
 
     linesize[0] = frame->linesize[0];