File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1088,17 +1088,21 @@ private bool IsValidXref()
10881088 content += _lexer . ReadRawString ( content_pos , read_length ) ;
10891089
10901090 int ss = content . IndexOf ( "stream" , StringComparison . Ordinal ) ;
1091+ int eof = content . IndexOf ( "%%EOF" , StringComparison . Ordinal ) ;
10911092 int es = content . IndexOf ( "endstream" , StringComparison . Ordinal ) ;
10921093
1093- if ( ss < es )
1094- {
1095- // Not inside of stream
1096- break ;
1097- }
1098- else if ( es != - 1 && ss > es )
1094+ int s = Math . Min ( ss , eof ) ;
1095+
1096+ if ( s != es )
10991097 {
1100- // inside of stream
1101- return false ;
1098+ if ( s == - 1 )
1099+ return false ;
1100+ else if ( es == - 1 )
1101+ break ;
1102+ else if ( s < es )
1103+ break ;
1104+ else if ( s > es )
1105+ return false ;
11021106 }
11031107
11041108 content_pos = content_pos + read_length ;
You can’t perform that action at this time.
0 commit comments