diff mbox series

[FFmpeg-devel,3/3] avcodec/intrax8: Check for end of bitstream in ff_intrax8_decode_picture()

Message ID 20200206134549.29792-3-michael@niedermayer.cc
State Accepted
Commit 0a9ccc2514da82812584b0e49a30625151d225e9
Headers show
Series [FFmpeg-devel,1/3] avcodec/cavsdsp: Fix invalid left shifts in cavs_idct8_add_c() | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Michael Niedermayer Feb. 6, 2020, 1:45 p.m. UTC
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>
---
 libavcodec/intrax8.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Niedermayer April 26, 2020, 4:24 p.m. UTC | #1
On Thu, Feb 06, 2020 at 02:45:49PM +0100, Michael Niedermayer wrote:
> 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>
> ---
>  libavcodec/intrax8.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply

[...]
diff mbox series

Patch

diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index d46f97c7a4..f385423dc1 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -801,6 +801,8 @@  int ff_intrax8_decode_picture(IntraX8Context *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))