aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-22 23:53:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-22 23:54:33 +0200
commitcfd1ecdc0bb039014fbb40b45edb88121bad92f9 (patch)
tree2cbace9962b18255b4953dc31d9d662307347473
parentf95f9f975598262d7acdf9f4611bd1e775203f7b (diff)
downloadffmpeg-cfd1ecdc0bb039014fbb40b45edb88121bad92f9.tar.gz
avcodec/asvdec: Check buf_size
Fixes Timeout Fixes: 1746/clusterfuzz-testcase-minimized-6687393392361472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/asvdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c
index 603a09253b..467e2554ca 100644
--- a/libavcodec/asvdec.c
+++ b/libavcodec/asvdec.c
@@ -210,6 +210,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVFrame *const p = data;
int mb_x, mb_y, ret;
+ if (buf_size * 8LL < a->mb_height2 * a->mb_width2 * 13LL)
+ return AVERROR_INVALIDDATA;
+
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
return ret;
p->pict_type = AV_PICTURE_TYPE_I;