diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-02-06 00:33:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-01 12:49:26 +0200 |
commit | 01436cc976d3cea58bef9534dc8230d11690aebe (patch) | |
tree | 13b2940384b135e09c264ad4eb1d602eb27d9015 /libavcodec | |
parent | 0734772b794b5b6271fb5b306b6450316a5db579 (diff) | |
download | ffmpeg-01436cc976d3cea58bef9534dc8230d11690aebe.tar.gz |
avcodec/intrax8: Check for end of bitstream in ff_intrax8_decode_picture()
Fixes: Timeout (105sec -> 1sec)
Fixes: 20479/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5769846937878528
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0a9ccc2514da82812584b0e49a30625151d225e9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/intrax8.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index 5e1233bf0a..198ab7fea2 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -801,6 +801,8 @@ int ff_intrax8_decode_picture(IntraX8Context *const w, Picture *pict, for (w->mb_y = 0; w->mb_y < w->mb_height * 2; w->mb_y++) { x8_init_block_index(w, w->frame); mb_xy = (w->mb_y >> 1) * (w->mb_width + 1); + if (get_bits_left(gb) < 1) + goto error; for (w->mb_x = 0; w->mb_x < w->mb_width * 2; w->mb_x++) { x8_get_prediction(w); if (x8_setup_spatial_predictor(w, 0)) |