aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-02-17 04:20:52 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-02-18 23:28:53 +0100
commit603d23ffebdd6891167ad6c439e27517e7227a9d (patch)
treed8795b25091f4656a190da71bda4d9eb3aadef8b
parent09dad52390025b8ab73c4196cd616a7e4410cf32 (diff)
downloadffmpeg-603d23ffebdd6891167ad6c439e27517e7227a9d.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>
-rw-r--r--libavcodec/vp8.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index da28032d9f..3adecba2f0 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -605,6 +605,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)