diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-12-17 11:16:22 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-12-17 11:16:22 +0000 |
commit | 880ed0a3dd992d4ab6b8f1d73f862fb930dc2eaa (patch) | |
tree | aa2d80d55cc66f9be936ea4d1459130e1d7be258 /fitz | |
parent | b20c8c628feab388f5d9b738326b8fbc35d8a742 (diff) | |
download | mupdf-880ed0a3dd992d4ab6b8f1d73f862fb930dc2eaa.tar.xz |
More Memory Squeezing fixes.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/res_pixmap.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c index 1f81e0e1..99132a31 100644 --- a/fitz/res_pixmap.c +++ b/fitz/res_pixmap.c @@ -50,14 +50,22 @@ fz_new_pixmap_with_data(fz_context *ctx, fz_colorspace *colorspace, int w, int h pix->n = 1 + colorspace->n; } + pix->samples = samples; if (samples) { - pix->samples = samples; pix->free_samples = 0; } else { - pix->samples = fz_malloc_array(ctx, pix->h, pix->w * pix->n); + fz_try(ctx) + { + pix->samples = fz_malloc_array(ctx, pix->h, pix->w * pix->n); + } + fz_catch(ctx) + { + fz_free(ctx, pix); + fz_rethrow(ctx); + } pix->free_samples = 1; } |