Open
Description
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
andRELEASE
mode - I have searched open and closed issues to ensure it has not already been reported
ImageSharp version
3.1.10
Other ImageSharp packages and versions
3.1.10
Environment (Operating system, version and so on)
Windows 10 Pro, version 2009
.NET Framework version
.net 9.0
Description
If the image is corrupted - the "SOS" marker is missing - NullReferenceException
is thrown when loading the image. Although a more appropriate error would be ImageFormatException
, I suppose.
Steps to Reproduce
- Download any picture.
- Transform to bytes.
- Remove all SOS markers.
- Initialize stream with bytes.
- Try to load image from stream.
- NRE is thrown instead of more appropriate exception.
Test project to reproduce this issue: SixLabors.NREWhileLoadingImage.zip
Images
No response