Roughsketch / imagesize

Quickly probe the size of various image formats without reading the entire file.
MIT License
57 stars 12 forks source link

Add support for ILBM #36

Closed KateMorley closed 2 months ago

KateMorley commented 2 months ago

This PR adds support for the ILBM (Interleaved Bitmap) format, also known as IFF (which is the container format used by ILBM). ILBM was the main image format used on the Amiga, and is still supported as a save format by Photoshop to this day.

Roughsketch commented 2 months ago

Thanks for the PR, I'll try to review when I have time.

Roughsketch commented 2 months ago

Thank you very much for addressing the changes! I'll do another pass when I can and probably get this merged soon. After it's merged I'll still be waiting on the other open PRs to get resolved, but this will be out in 0.13.0.

KateMorley commented 2 months ago

Ran a quick fuzzer pass and the following input crashes:

46 4F 52 4D 30 30 30 30 49 4C 42 4D 73 31 73 3D FF FF FF FF

A chunk with length u32::MAX caused an overflow when adding the padding byte to determine the number of bytes to skip. I’ve fixed it to cast to u64 before the addition rather than after.