summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fitz/image_jpx.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fitz/image_jpx.c b/fitz/image_jpx.c
index af5ef263..04bcfecd 100644
--- a/fitz/image_jpx.c
+++ b/fitz/image_jpx.c
@@ -70,11 +70,20 @@ fz_load_jpx(fz_context *ctx, unsigned char *data, int size, fz_colorspace *defcs
for (k = 1; k < jpx->numcomps; k++)
{
if (jpx->comps[k].w != jpx->comps[0].w)
+ {
+ opj_image_destroy(jpx);
fz_throw(ctx, "image components have different width");
+ }
if (jpx->comps[k].h != jpx->comps[0].h)
+ {
+ opj_image_destroy(jpx);
fz_throw(ctx, "image components have different height");
+ }
if (jpx->comps[k].prec != jpx->comps[0].prec)
+ {
+ opj_image_destroy(jpx);
fz_throw(ctx, "image components have different precision");
+ }
}
n = jpx->numcomps;