Repository navigation
Image.Load throws NullReferenceException #797
Copy link
Copy link
Closed
Description
Activity
@Metalnem It looks like your message is automated/auto generated. Would it be possible to also include a stack trace?
Sorry if I'm looking automated :) Anyway, here's the stack trace:
An unhandled exception of type 'System.NullReferenceException' occurred in SixLabors.ImageSharp.dll: 'Object reference not set to an instance of an object.' at SixLabors.ImageSharp.Formats.Jpeg.JpegDecoderCore.ProcessStartOfScanMarker() at SixLabors.ImageSharp.Formats.Jpeg.JpegDecoderCore.ParseStream(Stream stream, Boolean metadataOnly) at SixLabors.ImageSharp.Formats.Jpeg.JpegDecoderCore.Decode[TPixel](Stream stream) at SixLabors.ImageSharp.Formats.Jpeg.JpegDecoder.Decode[TPixel](Configuration configuration, Stream stream) at SixLabors.ImageSharp.Image.Decode[TPixel](Stream stream, Configuration config) at SixLabors.ImageSharp.Image.Load[TPixel](Configuration config, Stream stream, IImageFormat& format) at SixLabors.ImageSharp.Image.Load[TPixel](Configuration config, String path) at SixLabors.ImageSharp.Run.Program.Main(String[] args) in- added a commit that references this issue
on Jan 4, 2019 @Metalnem Just to confirm I understand it right: The image in fact is invalid, right?
According to the file header it's a JPEG (Jfif) file, and I can reproduce the bug, but the image can't be opened by the windows 10 image viewer, paint, paint.net or Gimp.
So we're going to throw an ImageFormatException stating that there is no readable SOF0 marker in this case.
PR incoming in a few minutes...
That's right, the image is invalid!
- added a commit that references this issue
on Jan 4, 2019 - added a commit that references this issue
on Jan 6, 2019
Metadata
Metadata
Assignees
Labels
No labels
Image.Load throws a NullReferenceException when loading the image from the attached archive. You can run the following code to reproduce it (the path variable should contain the path to the extracted file):
Found via SharpFuzz.