We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15ac2bb commit b9ae5efCopy full SHA for b9ae5ef
1 file changed
src/PdfSharp/Pdf.IO/Parser.cs
@@ -1088,14 +1088,17 @@ private bool IsValidXref()
1088
content += _lexer.ReadRawString(content_pos, read_length);
1089
1090
int ss = content.IndexOf("stream", StringComparison.Ordinal);
1091
+ int eof = content.IndexOf("%%EOF", StringComparison.Ordinal);
1092
int es = content.IndexOf("endstream", StringComparison.Ordinal);
1093
- if (ss < es)
1094
+ int s = Math.Min(ss, eof);
1095
+
1096
+ if (s < es)
1097
{
1098
// Not inside of stream
1099
break;
1100
}
- else if (es != -1 && ss > es)
1101
+ else if (s > es)
1102
1103
// inside of stream
1104
return false;
0 commit comments