diff options
-rw-r--r-- | include/mupdf/pdf/xref.h | 7 | ||||
-rw-r--r-- | source/pdf/pdf-xref.c | 4 |
2 files changed, 3 insertions, 8 deletions
diff --git a/include/mupdf/pdf/xref.h b/include/mupdf/pdf/xref.h index 1924b635..0df1970d 100644 --- a/include/mupdf/pdf/xref.h +++ b/include/mupdf/pdf/xref.h @@ -41,7 +41,7 @@ typedef struct pdf_xref_entry_s pdf_xref_entry; struct pdf_xref_entry_s { char type; /* 0=unset (f)ree i(n)use (o)bjstm */ - unsigned char flags; /* bit 0 = marked */ + unsigned char marked; /* marked to keep alive with pdf_mark_xref */ unsigned short gen; /* generation / objstm index */ int num; /* original object number (for decryption after renumbering) */ int64_t ofs; /* file offset / objstm object number */ @@ -50,11 +50,6 @@ struct pdf_xref_entry_s pdf_obj *obj; /* stored/cached object */ }; -enum -{ - PDF_OBJ_FLAG_MARK = 1, -}; - typedef struct pdf_xref_subsec_s pdf_xref_subsec; struct pdf_xref_subsec_s diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 71b74b65..4409681e 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -2814,7 +2814,7 @@ void pdf_mark_xref(fz_context *ctx, pdf_document *doc) pdf_xref_entry *entry = &sub->table[e]; if (entry->obj) { - entry->flags |= PDF_OBJ_FLAG_MARK; + entry->marked = 1; } } } @@ -2869,7 +2869,7 @@ void pdf_clear_xref_to_mark(fz_context *ctx, pdf_document *doc) * been updated */ if (entry->obj != NULL && entry->stm_buf == NULL) { - if ((entry->flags & PDF_OBJ_FLAG_MARK) == 0 && pdf_obj_refs(ctx, entry->obj) == 1) + if (!entry->marked && pdf_obj_refs(ctx, entry->obj) == 1) { pdf_drop_obj(ctx, entry->obj); entry->obj = NULL; |