diff options
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdf_parse.c | 2 | ||||
-rw-r--r-- | pdf/pdf_xref.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/pdf/pdf_parse.c b/pdf/pdf_parse.c index 7174c23a..57713b21 100644 --- a/pdf/pdf_parse.c +++ b/pdf/pdf_parse.c @@ -363,7 +363,9 @@ pdf_parse_dict(pdf_xref *xref, fz_stream *file, char *buf, int cap) val = fz_new_int(ctx, a); fz_dict_put(dict, key, val); fz_drop_obj(val); + val = NULL; fz_drop_obj(key); + key = NULL; goto skip; } if (tok == PDF_TOK_INT) diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c index b560d868..d47524b6 100644 --- a/pdf/pdf_xref.c +++ b/pdf/pdf_xref.c @@ -676,7 +676,6 @@ pdf_open_xref_with_stream(fz_stream *file, char *password) xref->trailer = NULL; } fz_warn(xref->ctx, "trying to repair broken xref"); - pdf_repair_xref(xref, xref->scratch, sizeof xref->scratch); repaired = 1; } @@ -684,6 +683,9 @@ pdf_open_xref_with_stream(fz_stream *file, char *password) { int hasroot, hasinfo; + if (repaired) + pdf_repair_xref(xref, xref->scratch, sizeof xref->scratch); + encrypt = fz_dict_gets(xref->trailer, "Encrypt"); id = fz_dict_gets(xref->trailer, "ID"); if (fz_is_dict(encrypt)) |