Commit 4ef27d40 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/indeo2: Check input size against resolution in ir2_decode_plane()

Fixes: Timeout (56 sec -> 14 sec)
Fixes: 13708/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO2_fuzzer-5656342004498432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent ff13a92a
...@@ -56,7 +56,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst ...@@ -56,7 +56,7 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
int j; int j;
int out = 0; int out = 0;
if (width & 1) if ((width & 1) || width * height / (2*(IR2_CODES - 0x7F)) > get_bits_left(&ctx->gb))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
/* first line contain absolute values, other lines contain deltas */ /* first line contain absolute values, other lines contain deltas */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment