Browse Source

avcodec/iff: Check input space before loop in decode_delta_d()

Fixes: Timeout (114sec ->108ms)
Fixes: 19290/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5740598116220928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3
Michael Niedermayer 5 years ago
parent
commit
e7af64178a
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/iff.c

+ 3
- 0
libavcodec/iff.c View File

@@ -1354,6 +1354,9 @@ static void decode_delta_d(uint8_t *dst,
bytestream2_init(&gb, buf + ofssrc, buf_end - (buf + ofssrc));

entries = bytestream2_get_be32(&gb);
if (entries * 8LL > bytestream2_get_bytes_left(&gb))
return;

while (entries && bytestream2_get_bytes_left(&gb) >= 8) {
int32_t opcode = bytestream2_get_be32(&gb);
unsigned offset = bytestream2_get_be32(&gb);


Loading…
Cancel
Save