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

Correctly break during Png decoding #2769

Merged
merged 3 commits into from
Jul 16, 2024
Merged

Conversation

JimBobSquarePants
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Fixes #2752

We weren't breaking from the loop only the nested switch. We were also missing a chunk break. The first fcTL chunk in a PNG is followed by one or more IDAT chunk, only subsequent fcTL chunks are followed by fdAT chunks.

The test image contains the following chunks.

IHDR, pHYs, acTL, fcTL, IDAT ×3, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT,
fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, 
fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT,
fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT,
fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL,
fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT,
fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, fcTL, fdAT, fdAT, IEND

@JimBobSquarePants JimBobSquarePants changed the title Correctly break during decoding Correctly break during Png decoding Jul 10, 2024
Copy link
Collaborator

@brianpopow brianpopow left a comment

Choose a reason for hiding this comment

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

looks good now

@JimBobSquarePants JimBobSquarePants merged commit d7ef0e2 into release/3.1.x Jul 16, 2024
8 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/fix-2752 branch July 16, 2024 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants