Commit 94077cf6 authored by Michael Niedermayer's avatar 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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 341f0129)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 506bbbc0
......@@ -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);
......
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