aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-01-06 11:15:35 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-01-06 19:34:11 +0100
commit96e495082aedc4fcf444e2c7ef301867ba3e0b1f (patch)
treeee3c14253ecf4c7c0af796c2ad35f11a62445d85 /libavcodec
parent4ec2daf0de1a30bdeffbeffefcb7211e96c04980 (diff)
downloadffmpeg-96e495082aedc4fcf444e2c7ef301867ba3e0b1f.tar.gz
avcodec/huffyuvdec: Check that slice height is non negative.
Fixes: out of array access Fixes: 12381/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5705474280783872 Fixes: 12384/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5725303345774592 Fixes: 12389/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5704033050820608 Fixes: 12391/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5707284146028544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/huffyuvdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 4e00692631..dfe3585e6e 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -1254,7 +1254,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
slices_info_offset = AV_RL32(avpkt->data + buf_size - 4);
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)
+ if (nb_slices * 8LL + slices_info_offset > buf_size - 16 || slice_height <= 0)
return AVERROR_INVALIDDATA;
} else {
slice_height = height;