aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-09-22 20:31:58 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-09-24 15:37:18 +0200
commit050b5e85cbe61414ba9b78f76a04b2488e816f42 (patch)
tree22a5a7206129a53bee8e42d27bb37b6b04636fad
parent6190e826471fd9d3a66685000b5b3e4d8b163013 (diff)
downloadffmpeg-050b5e85cbe61414ba9b78f76a04b2488e816f42.tar.gz
avcodec/svq3: Check for minimum size input
Fixes: Timeout Fixes: 71295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-4999941125111808 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/svq3.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index ce4c58e14f..f730358e2f 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -1400,6 +1400,9 @@ static int svq3_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
if (svq3_decode_slice_header(avctx))
return -1;
+ if (avpkt->size < s->mb_width * s->mb_height / 8)
+ return AVERROR_INVALIDDATA;
+
s->pict_type = s->slice_type;
if (s->pict_type != AV_PICTURE_TYPE_B)