avcodec/iff: Check ham vs bpp
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 22 Jun 2019 17:21:50 +0000 (19:21 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 8 Jul 2019 09:44:24 +0000 (11:44 +0200)
commitd534cb834564f440c6368b5c6597c67e1f97635d
tree55c9a31785bb91f40da01aedf79b8314a1ef3593
parent074f40608e19ce7ce44c320dda87836806991d59
avcodec/iff: Check ham vs bpp

This checks the ham value much stricter and avoids hitting cases which cannot be reached
with data from the libavformat demuxer.

Fixes: out of array access
Fixes: 15320/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5080476840099840
Fixes: 15423/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5630765833912320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f76d7352e05526fde7c607b9a9db536a5760af29)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/iff.c