diff --git a/src/foundation/src/PDFsharp/src/PdfSharp/Drawing.Internal/ImageImporterJpeg.cs b/src/foundation/src/PDFsharp/src/PdfSharp/Drawing.Internal/ImageImporterJpeg.cs index 76330bac..c06f8583 100644 --- a/src/foundation/src/PDFsharp/src/PdfSharp/Drawing.Internal/ImageImporterJpeg.cs +++ b/src/foundation/src/PDFsharp/src/PdfSharp/Drawing.Internal/ImageImporterJpeg.cs @@ -304,7 +304,8 @@ bool MoveToNextHeader(StreamReaderHelper stream) return false; // Check for standalone markers. - if (headerType == 0x01 || headerType >= 0xd0 && headerType <= 0xd7) + // Also check for zero-byte stuff in entropy-coded data segments. + if (headerType == 0x00 || headerType == 0x01 || headerType >= 0xd0 && headerType <= 0xd7) { stream.CurrentOffset += 2; return true;