System.DivideByZeroException: Attempted to divide by zero.
at SixLabors.ImageSharp.Formats.Jpeg.Components.SizeExtensions.DivideBy(Size a, Size b)
at SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.JpegComponent.Init()
at SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.JpegFrame.InitComponents()
at SixLabors.ImageSharp.Formats.Jpeg.JpegDecoderCore.ProcessStartOfFrameMarker(Int32 remaining, JpegFileMarker& frameMarker, Boolean metadataOnly)
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.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, Byte[] data)
Prerequisites
DEBUGandRELEASEmodeDescription
Image.Load throws DivideByZeroException when loading malformed JPG file.
Steps to Reproduce
Run the following code snippet with the
pathvariable containing the path to the file from the attached archive:You will get the following stack trace:
System Configuration
Found via SharpFuzz.