fix fuzzer bug

I mistakenly rewrote read_mft_common() to trust input_channels before
testing it's in safe range.  This CL restores the original order.

out/clang.xsan/fuzz_iccprofile_atf and the new test case repro'd this.

It looks like this might fix attached both issues, but I haven't looked
as hard at 32767 or repro'd it with MSAN.

Bug: oss-fuzz:32765, oss-fuzz:32767
Change-Id: I6f546ec304e6fe6fcf7f60872161e5ad9ca10e43
Commit-Queue: Brian Osman <>
Auto-Submit: Mike Klein <>
Reviewed-by: Brian Osman <>
4 files changed