-
-
Notifications
You must be signed in to change notification settings - Fork 887
Closed
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
DEBUGandRELEASEmode - I have searched open and closed issues to ensure it has not already been reported
ImageSharp version
Current main branch
Other ImageSharp packages and versions
None
Environment (Operating system, version and so on)
Windows 10
.NET Framework version
Any supported
Description
Attached jpeg is manually malformed image which doesn't even have a single SOS marker - it ends on incomplete DHT marker which lack a single byte.
However, decoder fails with NullReferenceException at unexpected place - in spectral -> pixel conversion code.
Stacktrace:
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.JpegComponentPostProcessor.CopyBlocksToColorBuffer(Int32 spectralStep) in ...\ImageSharp\src\ImageSharp\Formats\Jpeg\Components\Decoder\JpegComponentPostProcessor.cs:line 88
...
Steps to Reproduce
using var img = Image.Load<Rgba32>(path);