summaryrefslogtreecommitdiff
path: root/fitz/filt_jpxd.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-09-11 19:29:42 -0500
committerRobin Watts <robin.watts@artifex.com>2011-09-14 17:44:13 +0100
commit89ae81f651bfa112b8e07317eb6983beaf7cb212 (patch)
tree3f99dad1253b795629e66d45b915c1d72043242b /fitz/filt_jpxd.c
parentcefb81f1886685580a40b17b5e495a8a8a1ebeaf (diff)
downloadmupdf-89ae81f651bfa112b8e07317eb6983beaf7cb212.tar.xz
Initial import of exception handling code
Import exception handling code from WSS, modified to fit into the fitz world. With this code we have 'real' fz_try/fz_catch/fz_rethrow functions, handling a fz_except type. We therefore rename the existing fz_throw/ fz_catch/fz_rethrow to be fz_error_make/fz_error_handle/fz_error_note. We don't actually use fz_try/fz_catch/fz_rethrow yet...
Diffstat (limited to 'fitz/filt_jpxd.c')
-rw-r--r--fitz/filt_jpxd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fitz/filt_jpxd.c b/fitz/filt_jpxd.c
index 765aad29..d646cabc 100644
--- a/fitz/filt_jpxd.c
+++ b/fitz/filt_jpxd.c
@@ -34,7 +34,7 @@ fz_load_jpx_image(fz_pixmap **imgp, unsigned char *data, int size, fz_colorspace
int x, y, k, v;
if (size < 2)
- return fz_throw("not enough data to determine image format");
+ return fz_error_make("not enough data to determine image format");
/* Check for SOC marker -- if found we have a bare J2K stream */
if (data[0] == 0xFF && data[1] == 0x4F)
@@ -61,16 +61,16 @@ fz_load_jpx_image(fz_pixmap **imgp, unsigned char *data, int size, fz_colorspace
opj_destroy_decompress(info);
if (!jpx)
- return fz_throw("opj_decode failed");
+ return fz_error_make("opj_decode failed");
for (k = 1; k < jpx->numcomps; k++)
{
if (jpx->comps[k].w != jpx->comps[0].w)
- return fz_throw("image components have different width");
+ return fz_error_make("image components have different width");
if (jpx->comps[k].h != jpx->comps[0].h)
- return fz_throw("image components have different height");
+ return fz_error_make("image components have different height");
if (jpx->comps[k].prec != jpx->comps[0].prec)
- return fz_throw("image components have different precision");
+ return fz_error_make("image components have different precision");
}
n = jpx->numcomps;
@@ -112,7 +112,7 @@ fz_load_jpx_image(fz_pixmap **imgp, unsigned char *data, int size, fz_colorspace
if (!img)
{
opj_image_destroy(jpx);
- return fz_throw("out of memory");
+ return fz_error_make("out of memory");
}
p = img->samples;