summaryrefslogtreecommitdiff
path: root/fitz/res_font.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2011-01-27 22:35:26 +0000
committerTor Andersson <tor@ghostscript.com>2011-01-27 22:35:26 +0000
commit3802ebf92723382070258bcd43771b2f4186c03f (patch)
treecb0ca60a270dd9b73918015ee8e8cd86b1dc0296 /fitz/res_font.c
parent836d6cb3d16e94929be98c000a35255a5ffe37ff (diff)
downloadmupdf-3802ebf92723382070258bcd43771b2f4186c03f.tar.xz
Add fz_calloc function to check for integer overflow when allocating arrays, and change the signature of fz_realloc to match.
Diffstat (limited to 'fitz/res_font.c')
-rw-r--r--fitz/res_font.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fitz/res_font.c b/fitz/res_font.c
index eb5e4ef9..cfbb08bf 100644
--- a/fitz/res_font.c
+++ b/fitz/res_font.c
@@ -434,8 +434,8 @@ fz_newtype3font(char *name, fz_matrix matrix)
int i;
font = fz_newfont();
- font->t3procs = fz_malloc(sizeof(fz_buffer*) * 256);
- font->t3widths = fz_malloc(sizeof(float) * 256);
+ font->t3procs = fz_calloc(256, sizeof(fz_buffer*));
+ font->t3widths = fz_calloc(256, sizeof(float));
fz_strlcpy(font->name, name, sizeof(font->name));
font->t3matrix = matrix;