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

Hard crash (Internal CLR error) with corrupt PNG image #2714

Closed
4 tasks done
Erik-White opened this issue Apr 5, 2024 · 3 comments
Closed
4 tasks done

Hard crash (Internal CLR error) with corrupt PNG image #2714

Erik-White opened this issue Apr 5, 2024 · 3 comments
Labels

Comments

@Erik-White
Copy link

Erik-White commented Apr 5, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

ImageSharp version

3.1.3

Other ImageSharp packages and versions

N/A

Environment (Operating system, version and so on)

Windows 11

.NET Framework version

.NET 8.0

Description

Fatal error. Internal CLR error. (0x80131506)
at SixLabors.ImageSharp.PixelFormats.IPixel.ToRgba32(Rgba32& dest)
   at SixLabors.ImageSharp.Color.ToRgba32()
   at SixLabors.ImageSharp.Formats.Png.PngScanlineProcessor.ProcessInterlacedPaletteScanline[TPixel](FrameControl& frameControl, ReadOnlySpan`1 scanlineSpan, Span`1 rowSpan, UInt32 pixelOffset, UInt32 increment, Nullable`1 palette)
   at SixLabors.ImageSharp.Formats.Png.PngScanlineProcessor.ProcessPaletteScanline[TPixel](FrameControl& frameControl, ReadOnlySpan`1 scanlineSpan, Span`1 rowSpan, Nullable`1 palette)
   at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.ProcessDefilteredScanline[TPixel](FrameControl& frameControl, Int32 currentRow, ReadOnlySpan`1 scanline, ImageFrame`1 pixels, PngMetadata pngMetadata, Span`1 blendRowBuffer)
   at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.DecodePixelData[TPixel](FrameControl frameControl, DeflateStream compressedStream, ImageFrame`1 imageFrame, PngMetadata pngMetadata, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.ReadScanlines[TPixel](Int32 chunkLength, ImageFrame`1 image, PngMetadata pngMetadata, Func`1 getData, FrameControl& frameControl, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.Decode[TPixel](BufferedReadStream stream, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[TPixel](IImageDecoderInternals decoder, Configuration configuration, Stream stream, Func`3 largeImageExceptionFactory, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[TPixel](IImageDecoderInternals decoder, Configuration configuration, Stream stream, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.Png.PngDecoder.Decode[TPixel](PngDecoderOptions options, Stream stream, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.Png.PngDecoder.Decode(PngDecoderOptions options, Stream stream, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.SpecializedImageDecoder`1.Decode(DecoderOptions options, Stream stream, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.ImageDecoder.<>c__DisplayClass1_0.<Decode>b__0(Stream s)
   at SixLabors.ImageSharp.Formats.ImageDecoder.<WithSeekableStream>g__PeformActionAndResetPosition|11_0[T](Stream s, Int64 position, <>c__DisplayClass11_0`1& )
   at SixLabors.ImageSharp.Formats.ImageDecoder.WithSeekableStream[T](DecoderOptions options, Stream stream, Func`2 action)
   at SixLabors.ImageSharp.Formats.ImageDecoder.Decode(DecoderOptions options, Stream stream)
   at SixLabors.ImageSharp.Image.Decode(DecoderOptions options, Stream stream)
   at SixLabors.ImageSharp.Image.<>c__DisplayClass80_0.<Load>b__0(Stream s)
   at SixLabors.ImageSharp.Image.WithSeekableStream[T](DecoderOptions options, Stream stream, Func`2 action)
   at SixLabors.ImageSharp.Image.Load(DecoderOptions options, Stream stream)
   at SixLabors.ImageSharp.Image.Load(DecoderOptions options, String path)
   at SixLabors.ImageSharp.Image.Load(String path)

Steps to Reproduce

Attempt to load the attached image e.g.

using var image = Image.Load("59cbc08a-f1c4-4e8d-b094-bba786b2cc3e.png");

Images

59cbc08a-f1c4-4e8d-b094-bba786b2cc3e

@Erik-White
Copy link
Author

@JimBobSquarePants Thanks for your lightning fast response! Do you have an estimate for when you will be able to push a new release with the fix?

@JimBobSquarePants
Copy link
Member

Not a problem! We plan a proper release this week but in the interim there are nightlies you can try. The feed is linked from our readme.

@Erik-White
Copy link
Author

Thanks for the updated release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants