diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2012-08-06 15:31:00 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2012-08-06 15:31:00 +0200 |
commit | 45753e5b4a9b3370d6411d8400826014ac0fcce7 (patch) | |
tree | 5c7277bed833c20c1c36ebe1497296be5dddcf8a | |
parent | 9c021377135a931a11bab58d6fe30353a98f1092 (diff) | |
download | mupdf-45753e5b4a9b3370d6411d8400826014ac0fcce7.tar.xz |
Fix leak of page objects/refs for documents without page tree
PDF documents that do not have a page tree will have zero pages.
Calling fz_count_pages() twice or more on those documents will have
pdf_load_page_tree() repeatedly trying to load the page tree, each
time leaking the page objects/refs arrays.
Thanks to Zeniko for pointing out this fix.
-rw-r--r-- | pdf/pdf_page.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pdf/pdf_page.c b/pdf/pdf_page.c index 0733da2f..a6a0950b 100644 --- a/pdf/pdf_page.c +++ b/pdf/pdf_page.c @@ -154,7 +154,7 @@ pdf_load_page_tree(pdf_document *xref) pdf_obj *count; struct info info; - if (xref->page_len) + if (xref->page_refs) return; catalog = pdf_dict_gets(xref->trailer, "Root"); |