[FFmpeg-cvslog] avcodec/msrle: Check that the input is large enough to contain a end of picture code

Michael Niedermayer git at videolan.org
Sun Nov 18 04:02:15 EET 2018


ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Oct 21 14:40:14 2018 +0200| [e6f8f6a7eefd1fb29db17a86bba4434117eaab08] | committer: Michael Niedermayer

avcodec/msrle: Check that the input is large enough to contain a end of picture code

Fixes: Timeout
Fixes: 10625/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSRLE_fuzzer-5659651283091456

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 203ccb8746997777ce66beadd53b4631d217b9cd)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index adb55b1302..1ab8a41985 100644
--- a/libavcodec/msrle.c
+++ b/libavcodec/msrle.c
@@ -95,6 +95,9 @@ static int msrle_decode_frame(AVCodecContext *avctx,
     s->buf = buf;
     s->size = buf_size;
 
+    if (buf_size < 2) //Minimally a end of picture code should be there
+        return AVERROR_INVALIDDATA;
+
     if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
         return ret;
 



More information about the ffmpeg-cvslog mailing list