Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ILBM #36

Merged
merged 3 commits into from
Jun 9, 2024
Merged

Add support for ILBM #36

merged 3 commits into from
Jun 9, 2024

Conversation

KateMorley
Copy link
Contributor

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
Copy link
Owner

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

src/formats/ilbm.rs Outdated Show resolved Hide resolved
src/formats/ilbm.rs Outdated Show resolved Hide resolved
Copy link
Owner

@Roughsketch Roughsketch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a few things that might need to be looked at.

@KateMorley KateMorley requested a review from Roughsketch June 8, 2024 13:19
@Roughsketch
Copy link
Owner

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.

Copy link
Owner

@Roughsketch Roughsketch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

image

Issue seems to be adding with overflow (4294967295 + 1).

There is similar code in the JXL parser you can use as reference:

let box_end = box_start
    .checked_add(box_size)
    .ok_or(ImageError::CorruptedImage)?;

I will be away for a while, but will run another fuzzer pass after this is resolved.

@KateMorley
Copy link
Contributor Author

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.

Copy link
Owner

@Roughsketch Roughsketch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me!

@Roughsketch Roughsketch merged commit fa39d42 into Roughsketch:master Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants