summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/html/html-doc.c2
-rw-r--r--source/pdf/pdf-xref.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/source/html/html-doc.c b/source/html/html-doc.c
index 6ad5c3e8..23f1195b 100644
--- a/source/html/html-doc.c
+++ b/source/html/html-doc.c
@@ -144,7 +144,7 @@ htdoc_open_document(fz_context *ctx, const char *filename)
fz_dirname(dirname, filename, sizeof dirname);
- doc = fz_malloc_struct(ctx, html_document);
+ doc = fz_new_document(ctx, sizeof *doc);
doc->super.close = htdoc_close_document;
doc->super.layout = htdoc_layout;
doc->super.count_pages = htdoc_count_pages;
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index f8711d3c..6eca8a74 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -2325,9 +2325,8 @@ pdf_page_presentation(fz_context *ctx, pdf_page *page, float *duration)
static pdf_document *
pdf_new_document(fz_context *ctx, fz_stream *file)
{
- pdf_document *doc = fz_malloc_struct(ctx, pdf_document);
+ pdf_document *doc = fz_new_document(ctx, sizeof *doc);
- doc->super.refs = 1;
doc->super.close = (fz_document_close_fn *)pdf_close_document;
doc->super.needs_password = (fz_document_needs_password_fn *)pdf_needs_password;
doc->super.authenticate_password = (fz_document_authenticate_password_fn *)pdf_authenticate_password;