[FFmpeg-cvslog] avcodec/qdrw: Check input for header/skiped space before get_buffer()

Michael Niedermayer git at videolan.org
Fri Oct 25 01:25:54 EEST 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Oct  7 16:14:32 2019 +0200| [b63fbc19c09d0b42da4f83c21fcf362d6ed7c545] | committer: Michael Niedermayer

avcodec/qdrw: Check input for header/skiped space before get_buffer()

Fixes: Timeout (21sec -> 0.8sec)
Fixes: 17990/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDRAW_fuzzer-5200374436200448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/qdrw.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 32ba410968..65279c9805 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -455,6 +455,8 @@ static int decode_frame(AVCodecContext *avctx,
                 avpriv_request_sample(avctx, "Pack type %d", pack_type);
                 return AVERROR_PATCHWELCOME;
             }
+            if (bytestream2_get_bytes_left(&gbc) < 30)
+                return AVERROR_INVALIDDATA;
             if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
                 return ret;
 



More information about the ffmpeg-cvslog mailing list