diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2009-03-03 00:55:14 +0100 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2009-03-03 00:55:14 +0100 |
commit | ff46c12e0f8db6fc410cfdc3dd032734ce07b2e3 (patch) | |
tree | 424b7f525dee0677a94fc279fa62ed19619f029d | |
parent | 2b02f0965e580925bfa41b2c19a0f38ac4205e3e (diff) | |
download | mupdf-ff46c12e0f8db6fc410cfdc3dd032734ce07b2e3.tar.xz |
Fix reference counting of indexed and separation base colorspaces.
-rw-r--r-- | mupdf/pdf_colorspace1.c | 2 | ||||
-rw-r--r-- | mupdf/pdf_image.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/mupdf/pdf_colorspace1.c b/mupdf/pdf_colorspace1.c index 31245bc3..dbc21a78 100644 --- a/mupdf/pdf_colorspace1.c +++ b/mupdf/pdf_colorspace1.c @@ -518,6 +518,7 @@ loadseparation(fz_colorspace **csp, pdf_xref *xref, fz_obj *array) fz_dropobj(baseobj); if (error) return fz_rethrow(error, "cannot load base colorspace"); + fz_keepcolorspace(base); error = pdf_loadfunction(&tint, xref, tintobj); if (error) @@ -595,6 +596,7 @@ loadindexed(fz_colorspace **csp, pdf_xref *xref, fz_obj *array) fz_dropobj(baseobj); if (error) return fz_rethrow(error, "cannot load base colorspace"); + fz_keepcolorspace(base); pdf_logrsrc("base %s\n", base->name); diff --git a/mupdf/pdf_image.c b/mupdf/pdf_image.c index c7c96c5b..d81cf14c 100644 --- a/mupdf/pdf_image.c +++ b/mupdf/pdf_image.c @@ -78,6 +78,7 @@ pdf_loadinlineimage(pdf_image **imgp, pdf_xref *xref, pdf_logimage("indexed\n"); img->indexed = (pdf_indexed*)img->super.cs; img->super.cs = img->indexed->base; + fz_keepcolorspace(img->super.cs); } pdf_logimage("colorspace %s\n", img->super.cs->name); @@ -289,6 +290,7 @@ pdf_loadimage(pdf_image **imgp, pdf_xref *xref, fz_obj *dict, fz_obj *ref) pdf_logimage("indexed\n"); indexed = (pdf_indexed*)cs; cs = indexed->base; + fz_keepcolorspace(cs); } n = cs->n; a = 0; |