aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-11-15 17:11:12 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-01-08 23:19:14 +0100
commitd6ff6dc56bf3a719ebdf922f95c88889623337a8 (patch)
tree20ba4e8590988ad21106ac834b325d429f386506 /libavcodec
parent37a14a3d83a3b988c061ef5004141fe49eae33e0 (diff)
downloadffmpeg-d6ff6dc56bf3a719ebdf922f95c88889623337a8.tar.gz
avcodec/zmbv: Check that the buffer is large enough for mvec
Fixes: Timeout Fixes: 4143/clusterfuzz-testcase-4736864637419520 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 2ab9568a2c3349039eec29fb960fe39de354b514) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/zmbv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index f126515bd1..5deef804bc 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -539,6 +539,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
} else {
frame->key_frame = 0;
frame->pict_type = AV_PICTURE_TYPE_P;
+ if (c->decomp_len < 2LL * ((c->width + c->bw - 1) / c->bw) * ((c->height + c->bh - 1) / c->bh))
+ return AVERROR_INVALIDDATA;
if (c->decomp_len)
c->decode_xor(c);
}