Browse Source

avcodec/qdrw: Check input for header/skiped space before get_buffer()

Fixes: Timeout (21sec -> 0.8sec)
Fixes: 17990/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDRAW_fuzzer-5200374436200448

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 b63fbc19c0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.2.15
Michael Niedermayer 6 years ago
parent
commit
ae1cc1089f
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/qdrw.c

+ 2
- 0
libavcodec/qdrw.c View File

@@ -285,6 +285,8 @@ static int decode_frame(AVCodecContext *avctx,
avpriv_request_sample(avctx, "Pack type %d", pack_type);
return AVERROR_PATCHWELCOME;
}
if (bytestream2_get_bytes_left(&gbc) < 30)
return AVERROR_INVALIDDATA;
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
return ret;



Loading…
Cancel
Save