aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-07 16:14:32 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-15 12:25:46 +0100
commit7b0ad24b1042d34470911fc43474a0c00eb79838 (patch)
treef035f8e348f4453dd1e88a1f7a5e51dcd86b8ce5
parent4ed397df65552c2a50d78614124d94e9c2e857dc (diff)
downloadffmpeg-7b0ad24b1042d34470911fc43474a0c00eb79838.tar.gz
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 b63fbc19c09d0b42da4f83c21fcf362d6ed7c545) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/qdrw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 3a0bc6f760..34c1442063 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -453,6 +453,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;