summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2016-09-28 20:00:47 +0100
committerRobin Watts <robin.watts@artifex.com>2016-10-05 19:37:12 +0100
commitda940e1c59d5305af22726cfe13fc96ec23147a1 (patch)
tree91aa232fbfa6e7e9a6e2d4b664a42396d57268f6
parentc2901d60fa98874d4a36cf1ab57a03cb80fde038 (diff)
downloadmupdf-da940e1c59d5305af22726cfe13fc96ec23147a1.tar.xz
Simplify fz_new_type3_font
Call fz_calloc rather than fz_malloc_array and then manually clearing.
-rw-r--r--source/fitz/font.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c
index b406c259..3fde0aec 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -1110,15 +1110,14 @@ fz_font *
fz_new_type3_font(fz_context *ctx, const char *name, const fz_matrix *matrix)
{
fz_font *font;
- int i;
font = fz_new_font(ctx, name, 1, 256);
fz_try(ctx)
{
- font->t3procs = fz_malloc_array(ctx, 256, sizeof(fz_buffer*));
- font->t3lists = fz_malloc_array(ctx, 256, sizeof(fz_display_list*));
- font->t3widths = fz_malloc_array(ctx, 256, sizeof(float));
- font->t3flags = fz_malloc_array(ctx, 256, sizeof(unsigned short));
+ font->t3procs = fz_calloc(ctx, 256, sizeof(fz_buffer*));
+ font->t3lists = fz_calloc(ctx, 256, sizeof(fz_display_list*));
+ font->t3widths = fz_calloc(ctx, 256, sizeof(float));
+ font->t3flags = fz_calloc(ctx, 256, sizeof(unsigned short));
}
fz_catch(ctx)
{
@@ -1127,13 +1126,6 @@ fz_new_type3_font(fz_context *ctx, const char *name, const fz_matrix *matrix)
}
font->t3matrix = *matrix;
- for (i = 0; i < 256; i++)
- {
- font->t3procs[i] = NULL;
- font->t3lists[i] = NULL;
- font->t3widths[i] = 0;
- font->t3flags[i] = 0;
- }
return font;
}