[FFmpeg-cvslog] avcodec/vp8: Check bitstream input in vp7_fade_frame() before time consuming operation

Michael Niedermayer git at videolan.org
Wed Sep 12 01:53:12 EEST 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Jun 24 02:43:18 2018 +0200| [74af6ae02100ff05f8a09fde5db4cd06509cdfba] | committer: Michael Niedermayer

avcodec/vp8: Check bitstream input in vp7_fade_frame() before time consuming operation

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=74af6ae02100ff05f8a09fde5db4cd06509cdfba
---

 libavcodec/vp8.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 3adfeac3d9..a06692c476 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -507,6 +507,9 @@ static int vp7_fade_frame(VP8Context *s, VP56RangeCoder *c)
     int beta  = (int8_t) vp8_rac_get_uint(c, 8);
     int ret;
 
+    if (c->end <= c->buffer && c->bits >= 0)
+        return AVERROR_INVALIDDATA;
+
     if (!s->keyframe && (alpha || beta)) {
         int width  = s->mb_width * 16;
         int height = s->mb_height * 16;



More information about the ffmpeg-cvslog mailing list