In some cases colorspace will be leaked $ svn diff Index: mupdf/pdf_image.c =================================================================== --- mupdf/pdf_image.c (revision 1077) +++ mupdf/pdf_image.c (working copy) @@ -288,6 +288,7 @@ if (!strcmp(cs->name, "Indexed")) { pdf_logimage("indexed\n"); + fz_dropcolorspace(cs); indexed = (pdf_indexed*)cs; cs = indexed->base; fz_keepcolorspace(cs);
Patch above is incorrect. While leak is real and is fixed by the changed, it also gets triggered in other code paths where it shouldn't.
We need to refactor the image loading code, it's too fragile and doesn't work well with JPEG2000 colorspace issues.