[FFmpeg-cvslog] avcodec/diracdec: Check that slices are fewer than pixels

Michael Niedermayer git at videolan.org
Tue Aug 13 23:29:10 EEST 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Aug  1 01:49:47 2019 +0200| [fbbc8ba67f19d55380b1bc8b5f057328c266d747] | committer: Michael Niedermayer

avcodec/diracdec: Check that slices are fewer than pixels

Fixes: Timeout (197sec ->144ms)
Fixes: 15034/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5733549405110272

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=fbbc8ba67f19d55380b1bc8b5f057328c266d747
---

 libavcodec/diracdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 7b9e0099df..22ec913bf7 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1276,7 +1276,9 @@ static int dirac_unpack_idwt_params(DiracContext *s)
         s->num_y        = get_interleaved_ue_golomb(gb);
         if (s->num_x * s->num_y == 0 || s->num_x * (uint64_t)s->num_y > INT_MAX ||
             s->num_x * (uint64_t)s->avctx->width  > INT_MAX ||
-            s->num_y * (uint64_t)s->avctx->height > INT_MAX
+            s->num_y * (uint64_t)s->avctx->height > INT_MAX ||
+            s->num_x > s->avctx->width ||
+            s->num_y > s->avctx->height
         ) {
             av_log(s->avctx,AV_LOG_ERROR,"Invalid numx/y\n");
             s->num_x = s->num_y = 0;



More information about the ffmpeg-cvslog mailing list