colorMap is not freed on broken file. ==10237== 1,472,616 (217,200 direct, 1,255,416 indirect) bytes in 181 blocks are definitely lost in loss record 45 of 46 ==10237== at 0x4C2C25D: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==10237== by 0x4FC00D4: Gfx::doImage(Object*, Stream*, bool) (in /usr/lib64/libpoppler.so.60.0.0) ==10237== by 0x4FBEEE9: Gfx::opXObject(Object*, int) (in /usr/lib64/libpoppler.so.60.0.0) ==10237== by 0x4FABE4B: Gfx::execOp(Object*, Object*, int) (in /usr/lib64/libpoppler.so.60.0.0) ==10237== by 0x4FAB6DF: Gfx::go(bool) (in /usr/lib64/libpoppler.so.60.0.0) ==10237== by 0x4FAB4B0: Gfx::display(Object*, bool) (in /usr/lib64/libpoppler.so.60.0.0) ==10237== by 0x50180C2: Page::displaySlice(OutputDev*, double, double, int, bool, bool, int, int, int, int, bool, bool (*)(void*), void*, bool (*)(Annot*, void*), void*, bool) (in /usr/lib64/libpoppler.so.60.0.0) ==10237== by 0x5017AFF: Page::display(OutputDev*, double, double, int, bool, bool, bool, bool (*)(void*), void*, bool (*)(Annot*, void*), void*, bool) (in /usr/lib64/libpoppler.so.60.0.0) ==10237== by 0x501BB8E: PDFDoc::displayPage(OutputDev*, int, double, double, int, bool, bool, bool, bool (*)(void*), void*, bool (*)(Annot*, void*), void*, bool) (in /usr/lib64/libpoppler.so.60.0.0) ==10237== by 0x501BC2F: PDFDoc::displayPages(OutputDev*, int, int, double, double, int, bool, bool, bool, bool (*)(void*), void*, bool (*)(Annot*, void*), void*) (in /usr/lib64/libpoppler.so.60.0.0) ==10237== by 0x40EEF4: main (in /usr/bin/pdftohtml)
Created attachment 124160 [details] memory-leak-colorMap.pdf
Created attachment 124161 [details] [review] memory-leak-colorMap.patch Proposal patch.
Created attachment 124163 [details] [review] memory-leak-colorMap-2.patch A better patch with maskObj and smaskObj.
For this i wanted to ask the membership to allow the use of C++11 for things like std::unique_ptr that will delete colorMap when it goes of scope. And i also wanted to introduce something like a ObjectDeleter that will free the object when it goes out of scope so we don't have to do all that managing by hand. I'll send the email now and let's see what the community thinks. Meanwhile let's put this on hold since the leak it only happens on wrong documents it's not *that* important.
No problem. I just wanted to see how deep I can go with afl. There's few things I'd like to hack with afl but I don't know if I'll be able to find something more. I will keep you in touch. About C++11 and std::unique_ptr, I'm agree with you. I didn't asked about it because the source is "C++11"less.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/419.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.