[FFmpeg-cvslog] avcodec/magicyuv: Check that vlc len is not too large
Michael Niedermayer
git at videolan.org
Tue Aug 1 15:44:00 EEST 2017
ffmpeg | branch: release/3.1 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jul 12 17:25:16 2017 +0200| [94077cf6735afd1a166848d388c3a59764e7c71c] | committer: Michael Niedermayer
avcodec/magicyuv: Check that vlc len is not too large
Fixes: runtime error: shift exponent -95 is negative
Fixes: 2568/clusterfuzz-testcase-minimized-4926115716005888
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 341f01290c2353669ed2263f56e1a9f4c67cc597)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=94077cf6735afd1a166848d388c3a59764e7c71c
---
libavcodec/magicyuv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
index 3bb4c5a8b4..fdd427920c 100644
--- a/libavcodec/magicyuv.c
+++ b/libavcodec/magicyuv.c
@@ -90,6 +90,8 @@ static int build_huff(VLC *vlc, uint8_t *len)
for (i = 0; i < 256; i++) {
he[i].sym = 255 - i;
he[i].len = len[i];
+ if (len[i] == 0 || len[i] > 32)
+ return AVERROR_INVALIDDATA;
}
AV_QSORT(he, 256, HuffEntry, ff_magy_huff_cmp_len);
More information about the ffmpeg-cvslog
mailing list