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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use source length as bounds when unpacking RGB planes #2599

Merged
merged 2 commits into from Dec 1, 2023

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

Uses the correct bounds for the operation and adds guard to ensure callers conform to requirements.

await image.SaveAsync(pausedStream, encoder, cts.Token);
});
}

// https://github.com/SixLabors/ImageSharp/issues/2595
[Theory]
[WithFile(TestImages.Jpeg.Baseline.ForestBridgeDifferentComponentsQuality, PixelTypes.Bgra32)]
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm explicitly using a real file here rather than a generated one to make it easier to do visual verification.

@JimBobSquarePants JimBobSquarePants added this to the v3.1.0 milestone Dec 1, 2023
@JimBobSquarePants JimBobSquarePants merged commit 07fd936 into main Dec 1, 2023
8 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/fix-2595 branch December 1, 2023 10:43
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.

Fatal error. System.AccessViolationException When Encode
2 participants