diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-08 01:42:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-17 11:35:00 +0100 |
commit | 41f93f941155f9f9dbb2d5e7f5d20b2238150836 (patch) | |
tree | c1db205dfdbee24eee58767a56db4cadaaf40807 /libavcodec/clearvideo.c | |
parent | dd2a2a51fe47361fa82c67f2a417e1706713eaef (diff) | |
download | ffmpeg-41f93f941155f9f9dbb2d5e7f5d20b2238150836.tar.gz |
avcodec/clearvideo: Check remaining data in P frames
Fixes: Timeout (19sec -> 419msec)
Fixes: 13411/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CLEARVIDEO_fuzzer-5733153811988480
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index ad3012f7b7..82df8f3752 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -555,6 +555,9 @@ static int clv_decode_frame(AVCodecContext *avctx, void *data, } else { int plane; + if (c->pmb_width * c->pmb_height > 8LL*(buf_size - bytestream2_tell(&gb))) + return AVERROR_INVALIDDATA; + if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) return ret; |