[FFmpeg-cvslog] avcodec/clearvideo: Check remaining data in P frames

Michael Niedermayer git at videolan.org
Thu Mar 21 20:15:36 EET 2019


ffmpeg | branch: release/4.0 | Michael Niedermayer <michael at niedermayer.cc> | Fri Mar  8 01:42:06 2019 +0100| [599cfce022b3d7f7b3641867254c7d8a2e027497] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 41f93f941155f9f9dbb2d5e7f5d20b2238150836)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index 5e2f019929..a533613a3e 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.c
@@ -558,6 +558,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;
 



More information about the ffmpeg-cvslog mailing list