Bug 690411 - memleak in pdf_loadimage
Summary: memleak in pdf_loadimage
Status: RESOLVED REMIND
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P4 normal
Assignee: Tor Andersson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-13 00:47 UTC by Krzysztof Kowalczyk
Modified: 2009-07-02 16:29 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Kowalczyk 2009-04-13 00:47:53 UTC
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);
Comment 1 Krzysztof Kowalczyk 2009-04-13 01:33:33 UTC
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.
Comment 2 Tor Andersson 2009-07-02 16:29:11 UTC
We need to refactor the image loading code, it's too fragile and doesn't work well with JPEG2000 
colorspace issues.