Commit 9ffa32b8 authored by Michael Niedermayer's avatar 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/ffmpegReviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6aaa01af
...@@ -1252,6 +1252,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ...@@ -1252,6 +1252,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
slice_height = AV_RL32(avpkt->data + buf_size - 8); slice_height = AV_RL32(avpkt->data + buf_size - 8);
nb_slices = AV_RL32(avpkt->data + buf_size - 12); nb_slices = AV_RL32(avpkt->data + buf_size - 12);
if (nb_slices * 8LL + slices_info_offset > buf_size - 16 || if (nb_slices * 8LL + slices_info_offset > buf_size - 16 ||
s->chroma_v_shift ||
slice_height <= 0 || nb_slices * (uint64_t)slice_height > height) slice_height <= 0 || nb_slices * (uint64_t)slice_height > height)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment