Browse Source

avcodec/jvdec: Check available input space before decode8x8()

Fixes: Timeout (78 sec -> 15 millisec)
Fixes: 13147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JV_fuzzer-5727107827630080

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 61523683c5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.4.6
Michael Niedermayer 7 years ago
parent
commit
3891dbf4cf
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/jvdec.c

+ 5
- 0
libavcodec/jvdec.c View File

@@ -170,6 +170,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
GetBitContext gb;
init_get_bits(&gb, buf, 8 * video_size);

if (avctx->height/8 * (avctx->width/8) > 4 * video_size) {
av_log(avctx, AV_LOG_ERROR, "Insufficient input data for dimensions\n");
return AVERROR_INVALIDDATA;
}

for (j = 0; j < avctx->height; j += 8)
for (i = 0; i < avctx->width; i += 8)
decode8x8(&gb,


Loading…
Cancel
Save