diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-09-21 15:01:36 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-09-21 15:01:36 +0200 |
commit | aa7668835afffd5a2a496a60ed6edb672f5af1a7 (patch) | |
tree | 92bc58eb4ee9d4f3b30f9b9919aa148b1e330471 /pdf/pdf_parse.c | |
parent | 69ed4a8f4dbfac7f2f1de925e34807e4fee3b27c (diff) | |
download | mupdf-aa7668835afffd5a2a496a60ed6edb672f5af1a7.tar.xz |
Rename malloc functions for arrays (fz_calloc and fz_realloc).
Diffstat (limited to 'pdf/pdf_parse.c')
-rw-r--r-- | pdf/pdf_parse.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pdf/pdf_parse.c b/pdf/pdf_parse.c index 04c67eca..b1f22e46 100644 --- a/pdf/pdf_parse.c +++ b/pdf/pdf_parse.c @@ -101,19 +101,19 @@ pdf_to_ucs2(fz_context *ctx, fz_obj *src) if (srclen >= 2 && srcptr[0] == 254 && srcptr[1] == 255) { - dstptr = dst = fz_calloc(ctx, (srclen - 2) / 2 + 1, sizeof(short)); + dstptr = dst = fz_malloc_array(ctx, (srclen - 2) / 2 + 1, sizeof(short)); for (i = 2; i + 1 < srclen; i += 2) *dstptr++ = srcptr[i] << 8 | srcptr[i+1]; } else if (srclen >= 2 && srcptr[0] == 255 && srcptr[1] == 254) { - dstptr = dst = fz_calloc(ctx, (srclen - 2) / 2 + 1, sizeof(short)); + dstptr = dst = fz_malloc_array(ctx, (srclen - 2) / 2 + 1, sizeof(short)); for (i = 2; i + 1 < srclen; i += 2) *dstptr++ = srcptr[i] | srcptr[i+1] << 8; } else { - dstptr = dst = fz_calloc(ctx, srclen + 1, sizeof(short)); + dstptr = dst = fz_malloc_array(ctx, srclen + 1, sizeof(short)); for (i = 0; i < srclen; i++) *dstptr++ = pdf_doc_encoding[srcptr[i]]; } |