diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 7f71a75e4b..62b9f8bc2d 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -656,6 +656,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)