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

Only exit JPEG scan decoding after multiple EOF hits #2701

Merged
merged 3 commits into from
Mar 19, 2024

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 #2638

Updates the JpegBitReader to only exit after we've hit the end of the file multiple times. This ensures that we do not skip over the last MCU.

cc @br3aker

@JimBobSquarePants JimBobSquarePants requested a review from a team March 18, 2024 14:35
@JimBobSquarePants JimBobSquarePants changed the base branch from main to release/3.1.x March 18, 2024 14:37
@JimBobSquarePants JimBobSquarePants changed the base branch from release/3.1.x to main March 18, 2024 14:37
@br3aker
Copy link
Contributor

br3aker commented Mar 19, 2024

Brilliant!
Spent countless evenings thinking how to achieve this without sacrificing performance/DOS defense....

@JimBobSquarePants
Copy link
Member Author

Brilliant! Spent countless evenings thinking how to achieve this without sacrificing performance/DOS defense....

I actually got the idea from changes @antonfirsov made to BufferedReadStream.

@JimBobSquarePants JimBobSquarePants merged commit 995cfee into main Mar 19, 2024
13 checks passed
@JimBobSquarePants JimBobSquarePants deleted the defect/2638 branch March 19, 2024 12:11
Visual-Vincent added a commit to Visual-Vincent/ImageSharp that referenced this pull request Jan 24, 2025
Visual-Vincent added a commit to Visual-Vincent/ImageSharp that referenced this pull request Jan 24, 2025
@Visual-Vincent Visual-Vincent mentioned this pull request Jan 24, 2025
4 tasks
Visual-Vincent added a commit to Visual-Vincent/ImageSharp that referenced this pull request Jan 24, 2025
antonfirsov added a commit that referenced this pull request Feb 24, 2025
JimBobSquarePants added a commit that referenced this pull request Feb 25, 2025
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.

ImageSharp sometimes add gray rectangle at the bottom right
2 participants