Skip to content

Conversation

KirillAldashkin
Copy link
Contributor

@KirillAldashkin KirillAldashkin commented Jul 22, 2024

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

Fix #2779 by accounting pixel size. Also fixed some width*height multuplication overflows:

using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;

Rgba64[] data = new Rgba64[65536];
using Image<Rgba64> img = Image.WrapMemory<Rgba64>(data, 65537, 65536);
// doesn't throw here but will blow up later

// ...here for example
img.SaveAsPng("output.png");

@CLAassistant
Copy link

CLAassistant commented Jul 22, 2024

CLA assistant check
All committers have signed the CLA.

@KirillAldashkin KirillAldashkin marked this pull request as ready for review July 22, 2024 19:35
Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

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

This all looks great. Thanks so much for your help!

@JimBobSquarePants JimBobSquarePants merged commit 57ecebf into SixLabors:main Jul 26, 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.

Fatal error. Internal CLR error when working with image created by pointer-based overload of Image.WrapMemory<TPixel>
3 participants