Browse Source

Throw for unsupported App0 markers.

pull/2189/head
James Jackson-South 3 years ago
parent
commit
e9049e278b
  1. 7
      src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

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

@ -744,9 +744,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
}
stream.Read(this.temp, 0, JFifMarker.Length);
remaining -= JFifMarker.Length;
if (!JFifMarker.TryParse(this.temp, out this.jFif))
{
JpegThrowHelper.ThrowNotSupportedException("Unknown App0 Marker - Expected JFIF.");
}
_ = JFifMarker.TryParse(this.temp, out this.jFif);
remaining -= JFifMarker.Length;
// TODO: thumbnail
if (remaining > 0)

Loading…
Cancel
Save