diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-28 22:29:57 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-15 12:25:45 +0100 |
commit | b4edee5cab63e1db7be93f9bb70cf3d62c83bcc2 (patch) | |
tree | 8da278a756b166d81ea7f0a2211638d928f66c04 | |
parent | 2a43d9f882d83b4d71e37c7b50114f70380a0bcf (diff) | |
download | ffmpeg-b4edee5cab63e1db7be93f9bb70cf3d62c83bcc2.tar.gz |
avcodec/eatqi: Check for minimum frame size
The minimum header is 8 bytes, the smallest bitstream that is passed to
the MB decode code is 4 bytes
Fixes: Timeout (35sec -> 18sec)
Fixes: 15800/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EATQI_fuzzer-5684154517159936
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5ffb8e879389fb0642654e3233cfeca1f9841e52)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/eatqi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 1a847a35da..2805bd00bb 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -131,6 +131,9 @@ static int tqi_decode_frame(AVCodecContext *avctx, AVFrame *frame = data; int ret, w, h; + if (buf_size < 12) + return AVERROR_INVALIDDATA; + t->avctx = avctx; w = AV_RL16(&buf[0]); |