Skip to content

Commit

Permalink
#797 - apply review remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
jongleur1983 committed Jan 4, 2019
1 parent 575c23d commit 59d76a0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,6 @@ public void ParseStream(Stream stream, bool metadataOnly = false)
case JpegConstants.Markers.SOS:
if (!metadataOnly)
{
if (this.Frame is null)
{
throw new ImageFormatException("no readable SOF marker found.");
}

this.ProcessStartOfScanMarker();
break;
}
Expand Down Expand Up @@ -864,6 +859,11 @@ private void ProcessDefineRestartIntervalMarker(int remaining)
/// </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++)
{
Expand Down

0 comments on commit 59d76a0

Please sign in to comment.