summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pdf/pdf_repair.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pdf/pdf_repair.c b/pdf/pdf_repair.c
index 067fe2cf..08adcb99 100644
--- a/pdf/pdf_repair.c
+++ b/pdf/pdf_repair.c
@@ -68,14 +68,20 @@ pdf_repair_obj(fz_stream *file, char *buf, int cap, int *stmofsp, int *stmlenp,
while ( tok != PDF_TOK_STREAM &&
tok != PDF_TOK_ENDOBJ &&
tok != PDF_TOK_ERROR &&
- tok != PDF_TOK_EOF )
+ tok != PDF_TOK_EOF &&
+ tok != PDF_TOK_INT )
{
error = pdf_lex(&tok, file, buf, cap, &len);
if (error)
return fz_rethrow(error, "cannot scan for endobj or stream token");
}
- if (tok == PDF_TOK_STREAM)
+ if (tok == PDF_TOK_INT)
+ {
+ while (len-- > 0)
+ fz_unread_byte(file);
+ }
+ else if (tok == PDF_TOK_STREAM)
{
int c = fz_read_byte(file);
if (c == '\r') {