Skip to content

NRE on JPEG image loading #882

@xakep139

Description

@xakep139

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

Description

Exception on loading specific JPEG image

Steps to Reproduce

using (Image.Load(@"D:\error.jpeg")) { }

with image error.zip will cause a NullReferenceException with message: Object reference not set to an instance of an object.
Here's the stacktrace:

   at SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.JpegFrame.Dispose()
   at SixLabors.ImageSharp.Formats.Jpeg.JpegDecoderCore.Dispose()
   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.WithSeekableStream[T](Configuration config, Stream stream, Func`2 action)
   at SixLabors.ImageSharp.Image.Load[TPixel](Configuration config, Stream stream, IImageFormat& format)
   at SixLabors.ImageSharp.Image.Load[TPixel](Configuration config, String path)
   at ImageSharpTest.Program.Main(String[] args) in C:\Users\user\Documents\ImageSharpTest\Program.cs:line 13

System Configuration

  • ImageSharp version: 1.0.0-beta0006
  • Other ImageSharp packages and versions:
  • Environment (Operating system, version and so on): Windows 10.0.17763
  • .NET Framework version: netcoreapp2.0
  • Additional information:

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions