summaryrefslogtreecommitdiff
path: root/fitz/filt_jpxd.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-09-14 17:36:57 +0100
committerRobin Watts <Robin.Watts@artifex.com>2011-09-15 14:50:17 +0100
commitb51ef0eea028c73b6379e832eaa34fff3fbbb927 (patch)
tree1ab685ccd356e7fdc832b2e3322c0486b2670cfb /fitz/filt_jpxd.c
parent89ae81f651bfa112b8e07317eb6983beaf7cb212 (diff)
downloadmupdf-b51ef0eea028c73b6379e832eaa34fff3fbbb927.tar.xz
Add context to mupdf.
Huge pervasive change to lots of files, adding a context for exception handling and allocation. In time we'll move more statics into there. Also fix some for(i = 0; i < function(...); i++) calls.
Diffstat (limited to 'fitz/filt_jpxd.c')
-rw-r--r--fitz/filt_jpxd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fitz/filt_jpxd.c b/fitz/filt_jpxd.c
index d646cabc..07d6a572 100644
--- a/fitz/filt_jpxd.c
+++ b/fitz/filt_jpxd.c
@@ -19,7 +19,7 @@ static void fz_opj_info_callback(const char *msg, void *client_data)
}
fz_error
-fz_load_jpx_image(fz_pixmap **imgp, unsigned char *data, int size, fz_colorspace *defcs)
+fz_load_jpx_image(fz_context *ctx, fz_pixmap **imgp, unsigned char *data, int size, fz_colorspace *defcs)
{
fz_pixmap *img;
opj_event_mgr_t evtmgr;
@@ -108,7 +108,7 @@ fz_load_jpx_image(fz_pixmap **imgp, unsigned char *data, int size, fz_colorspace
}
}
- img = fz_new_pixmap_with_limit(colorspace, w, h);
+ img = fz_new_pixmap_with_limit(ctx, colorspace, w, h);
if (!img)
{
opj_image_destroy(jpx);
@@ -138,9 +138,9 @@ fz_load_jpx_image(fz_pixmap **imgp, unsigned char *data, int size, fz_colorspace
{
if (n == 4)
{
- fz_pixmap *tmp = fz_new_pixmap(fz_device_rgb, w, h);
- fz_convert_pixmap(img, tmp);
- fz_drop_pixmap(img);
+ fz_pixmap *tmp = fz_new_pixmap(ctx, fz_device_rgb, w, h);
+ fz_convert_pixmap(ctx, img, tmp);
+ fz_drop_pixmap(ctx, img);
img = tmp;
}
fz_premultiply_pixmap(img);