aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/clearvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-26 01:37:14 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-26 01:38:03 +0200
commit43c394dcaebe9eec5802b420f273385473380909 (patch)
tree28e6f159c077881efd3aa6339632ef690e5e7a1f /libavcodec/clearvideo.c
parent8e87d146d798ca25d8f3a4520a6deb7946b39d73 (diff)
downloadffmpeg-43c394dcaebe9eec5802b420f273385473380909.tar.gz
avcodec/clearvideo: Check buf_size before decoding frame
Fixes; Timeout Fixes: 1826/clusterfuzz-testcase-minimized-5728569256837120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/clearvideo.c')
-rw-r--r--libavcodec/clearvideo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index 27b00ce820..a9fa0228bd 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.c
@@ -297,6 +297,11 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data,
c->pic->pict_type = frame_type & 0x20 ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
if (frame_type & 0x2) {
+ if (buf_size < c->mb_width * c->mb_height) {
+ av_log(avctx, AV_LOG_ERROR, "Packet too small\n");
+ return AVERROR_INVALIDDATA;
+ }
+
bytestream2_get_be32(&gb); // frame size;
c->ac_quant = bytestream2_get_byte(&gb);
c->luma_dc_quant = 32;