summaryrefslogtreecommitdiff
path: root/libavcodec/wcmv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-02 00:08:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-06-21 18:28:00 +0200
commitdd8720045cdc46536c7a13f091aaf4ddea93e048 (patch)
treeb245220e49bd6554a57d2bf34f1071bc44818cf2 /libavcodec/wcmv.c
parentd5a6b390ced64cfd33764930f8b1d3c6437a43b6 (diff)
downloadffmpeg-dd8720045cdc46536c7a13f091aaf4ddea93e048.tar.gz
avcodec/wcmv: check remaining space vs. blocks
Fixes: Timeout (18sec -> 7sec) Fixes: 14835/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5646714897170432 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/wcmv.c')
-rw-r--r--libavcodec/wcmv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wcmv.c b/libavcodec/wcmv.c
index 2988c15b23..0d60b9fe1f 100644
--- a/libavcodec/wcmv.c
+++ b/libavcodec/wcmv.c
@@ -154,6 +154,9 @@ static int decode_frame(AVCodecContext *avctx,
bytestream2_seek(&gb, 2, SEEK_SET);
}
+ if (bytestream2_get_bytes_left(&gb) < 8LL * blocks)
+ return AVERROR_INVALIDDATA;
+
if (s->prev_frame->data[0]) {
ret = av_frame_copy(frame, s->prev_frame);
if (ret < 0)