diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-17 04:20:52 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-06-18 01:16:03 +0200 |
commit | 3f6f1c24ebeeb9af552d8ec889c3a699402150b4 (patch) | |
tree | 46223c3832ffa3945896345a2c26caac2ad6d986 /libavcodec | |
parent | fe435d11fb595b997f297986efce3f32ca56ed0c (diff) | |
download | ffmpeg-3f6f1c24ebeeb9af552d8ec889c3a699402150b4.tar.gz |
avcodec/vp8: Check for bitstream end before vp7_fade_frame()
Fixes: Timeout
Fixes: 5653/clusterfuzz-testcase-5497680018014208
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 de675648cef7e451ca82fabaee0d8ec1fe653311)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vp8.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 7841a9d964..dbe3da0842 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -606,6 +606,8 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si s->fade_present = vp8_rac_get(c); } + if (c->end <= c->buffer && c->bits >= 0) + return AVERROR_INVALIDDATA; /* E. Fading information for previous frame */ if (s->fade_present && vp8_rac_get(c)) { if ((ret = vp7_fade_frame(s ,c)) < 0) |