Skip to content

Commit 27cbafe

Browse files
committed
Add SOF5 and SOF6 to the unsupported jpeg markers
1 parent 1ab5185 commit 27cbafe

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/ImageSharp/Formats/Jpeg/JpegConstants.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,16 @@ internal static class Markers
183183
/// </summary>
184184
public const byte SOF3 = 0xC3;
185185

186+
/// <summary>
187+
/// Start of Frame marker, differential, Huffman coding, Differential sequential DCT.
188+
/// </summary>
189+
public const byte SOF5 = 0xC5;
190+
191+
/// <summary>
192+
/// Start of Frame marker, differential, Huffman coding, Differential progressive DCT.
193+
/// </summary>
194+
public const byte SOF6 = 0xC6;
195+
186196
/// <summary>
187197
/// Start of Frame marker, differential lossless, Huffman coding.
188198
/// </summary>

src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,14 @@ internal void ParseStream(BufferedReadStream stream, HuffmanScanDecoder scanDeco
247247
this.ProcessStartOfFrameMarker(stream, remaining, fileMarker, metadataOnly);
248248
break;
249249

250+
case JpegConstants.Markers.SOF5:
251+
JpegThrowHelper.ThrowNotSupportedException("Decoding jpeg files with differential sequential DCT is not supported.");
252+
break;
253+
254+
case JpegConstants.Markers.SOF6:
255+
JpegThrowHelper.ThrowNotSupportedException("Decoding jpeg files with differential progressive DCT is not supported.");
256+
break;
257+
250258
case JpegConstants.Markers.SOF3:
251259
case JpegConstants.Markers.SOF7:
252260
JpegThrowHelper.ThrowNotSupportedException("Decoding lossless jpeg files is not supported.");

0 commit comments

Comments
 (0)