aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-02-18 23:28:33 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-04-29 23:31:02 +0200
commit55e344ee5aa6f6e04e50bbac457e0ca53433ab75 (patch)
tree8891ffefb717f2614a60c2dac5fad49334533a9b
parent59a9204b8a11a1428367d6e1ddc0ef123cfddb61 (diff)
downloadffmpeg-55e344ee5aa6f6e04e50bbac457e0ca53433ab75.tar.gz
avcodec/svq1dec: Check that there is data left after the header
Fixes: Timeout (21sec -> 255ms) Fixes: 20709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ1_fuzzer-5085075089915904 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/svq1dec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index b09abc20bf..25bd3d0253 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -602,6 +602,8 @@ static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
if (skip_1stop_8data_bits(bitbuf) < 0)
return AVERROR_INVALIDDATA;
}
+ if (get_bits_left(bitbuf) <= 0)
+ return AVERROR_INVALIDDATA;
s->width = width;
s->height = height;