diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-07-13 18:11:03 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-07-13 18:22:32 +0100 |
commit | ab770bef466d03bfcabef6d4429efc1e8d50557f (patch) | |
tree | 951b65e82d25616cee6a1fc9e2bb527eb4f94634 /source/pdf | |
parent | 42bb12c41e4f06a0158abf916a0ff6d1ea4faa74 (diff) | |
download | mupdf-ab770bef466d03bfcabef6d4429efc1e8d50557f.tar.xz |
Use fz_malloc_struct rather than fz_calloc.
This helps with Memento debugging, and looks neater.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-resources.c | 6 | ||||
-rw-r--r-- | source/pdf/pdf-xref.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source/pdf/pdf-resources.c b/source/pdf/pdf-resources.c index 07fc873f..9b539fa9 100644 --- a/source/pdf/pdf-resources.c +++ b/source/pdf/pdf-resources.c @@ -202,10 +202,10 @@ pdf_init_resource_tables(fz_context *ctx, pdf_document *doc) { fz_try(ctx) { - doc->resources = fz_calloc(ctx, 1, sizeof(pdf_resource_tables)); - doc->resources->image = fz_calloc(ctx, 1, sizeof(pdf_res_table)); + doc->resources = fz_malloc_struct(ctx, pdf_resource_tables); + doc->resources->image = fz_malloc_struct(ctx, pdf_res_table); doc->resources->image->search = res_image_search; - doc->resources->font = fz_calloc(ctx, 1, sizeof(pdf_res_table)); + doc->resources->font = fz_malloc_struct(ctx, pdf_res_table); doc->resources->font->search = res_font_search; } fz_catch(ctx) diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index f9f2f576..01b72d04 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -210,7 +210,7 @@ pdf_xref_entry *pdf_get_populating_xref_entry(fz_context *ctx, pdf_document *doc if (doc->num_xref_sections == 0) { - doc->xref_sections = fz_calloc(ctx, 1, sizeof(pdf_xref)); + doc->xref_sections = fz_malloc_struct(ctx, pdf_xref); doc->num_xref_sections = 1; } @@ -1365,7 +1365,7 @@ pdf_read_ocg(fz_context *ctx, pdf_document *doc) len = pdf_array_len(ctx, ocg); fz_try(ctx) { - desc = fz_calloc(ctx, 1, sizeof(*desc)); + desc = fz_malloc_struct(ctx, pdf_ocg_descriptor); desc->len = len; desc->ocgs = fz_calloc(ctx, len, sizeof(*desc->ocgs)); desc->intent = NULL; |