[FFmpeg-cvslog] avcodec/kgv1dec: Check that there is enough input for maximum RLE compression
Michael Niedermayer
git at videolan.org
Thu Feb 1 01:52:02 EET 2018
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Wed Nov 22 20:14:54 2017 +0100| [32a92a7a9b43db2bcd6f4b6234d9070397957378] | committer: Michael Niedermayer
avcodec/kgv1dec: Check that there is enough input for maximum RLE compression
Fixes: Timeout
Fixes: 4271/clusterfuzz-testcase-4676667768307712
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 3aad94bf2b140cfba8ae69d018da05d4948ef37f)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=32a92a7a9b43db2bcd6f4b6234d9070397957378
---
libavcodec/kgv1dec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c
index 5359411c76..a6bd9400ac 100644
--- a/libavcodec/kgv1dec.c
+++ b/libavcodec/kgv1dec.c
@@ -62,6 +62,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
h = (buf[1] + 1) * 8;
buf += 2;
+ if (avpkt->size < 2 + w*h / 513)
+ return AVERROR_INVALIDDATA;
+
if (w != avctx->width || h != avctx->height) {
av_freep(&c->frame_buffer);
av_freep(&c->last_frame_buffer);
More information about the ffmpeg-cvslog
mailing list