[FFmpeg-cvslog] avcodec/huffyuvdec: Check vertical subsampling in hymt

Michael Niedermayer git at videolan.org
Sat Jul 13 15:44:20 EEST 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Jul  4 00:16:49 2019 +0200| [9ffa32b81bede1dbb167dfceb48fe605b27a0890] | committer: Michael Niedermayer

avcodec/huffyuvdec: Check vertical subsampling in hymt

Fixes: out of array access
Fixes: 15484/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5765377054736384
Fixes: 15559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5710295743332352

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

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

 libavcodec/huffyuvdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 771481fd03..46dcfa8235 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -1252,6 +1252,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         slice_height = AV_RL32(avpkt->data + buf_size - 8);
         nb_slices = AV_RL32(avpkt->data + buf_size - 12);
         if (nb_slices * 8LL + slices_info_offset > buf_size - 16 ||
+            s->chroma_v_shift ||
             slice_height <= 0 || nb_slices * (uint64_t)slice_height > height)
             return AVERROR_INVALIDDATA;
     } else {



More information about the ffmpeg-cvslog mailing list