Skip to content
Snippets Groups Projects
Unverified Commit 80ec0ca9 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avformat/icodec: Check nb_pal

Fixes: signed integer overflow: 538976288 * 4 cannot be represented in type 'int'
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_ICO_fuzzer-6690068904935424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg


Reviewed-by: default avatarPeter Ross <pross@xvid.org>
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit db73ae0d)
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent d52ed1be
No related branches found
No related tags found
No related merge requests found
......@@ -204,6 +204,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
AV_WL32(buf + 32, image->nb_pal);
}
if (image->nb_pal > INT_MAX / 4 - 14 - 40)
return AVERROR_INVALIDDATA;
AV_WL32(buf - 4, 14 + 40 + image->nb_pal * 4);
AV_WL32(buf + 8, AV_RL32(buf + 8) / 2);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment