Browse Source

#797 - apply review remarks

af/merge-core
Peter Amrehn 7 years ago
parent
commit
1359bceb45
  1. 10
      src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

10
src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

@ -292,11 +292,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
case JpegConstants.Markers.SOS:
if (!metadataOnly)
{
if (this.Frame is null)
{
throw new ImageFormatException("no readable SOF marker found.");
}
this.ProcessStartOfScanMarker();
break;
}
@ -864,6 +859,11 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// </summary>
private void ProcessStartOfScanMarker()
{
if (this.Frame is null)
{
throw new ImageFormatException("No readable SOFn (Start Of Frame) marker found.");
}
int selectorsCount = this.InputStream.ReadByte();
for (int i = 0; i < selectorsCount; i++)
{

Loading…
Cancel
Save