Bug 91055 - poppler SplashFontSrc leaking in SplashOutputDev::doUpdateFont
Summary: poppler SplashFontSrc leaking in SplashOutputDev::doUpdateFont
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-22 09:36 UTC by Dmytro Morgun
Modified: 2015-07-15 08:09 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
This is suggested patch/fix for poppler/SplashOutputDev.cc (142 bytes, text/plain)
2015-06-22 09:36 UTC, Dmytro Morgun
Details
patch for SplashFontEngine.cc unref is back to windows (1.54 KB, text/plain)
2015-07-07 09:12 UTC, Dmytro Morgun
Details

Description Dmytro Morgun 2015-06-22 09:36:43 UTC
Created attachment 116648 [details]
This is suggested patch/fix for poppler/SplashOutputDev.cc

This fontsrc local variable in SplashOutputDev::doUpdateFont leaks memory.
I don't really undestand the code, however, looks like it just needs to be unreferenced regardless of if it is file.
Attached is the patch for poppler/SplashOutputDev.cc
Comment 1 Albert Astals Cid 2015-07-05 22:50:27 UTC
I guess this is a windows only problem, for the rest of platforms we're already unref'ing it in SplashFontEngine::load* inside a 
#ifndef _WIN32

If we add that unref wholesale as you suggest we're double freeing in non windows platforms so you'll need to propose a better patch, either adding the unref only for windows or seeing if we can actually remove those #ifndef _WIN32 in the  SplashFontEngine::load* functions
Comment 2 Dmytro Morgun 2015-07-07 09:10:27 UTC
Removing the ifndef for windows worked fine for me. I haven't run all the test, though (only some set of files we need), but I can't see why windows is any different here.
Comment 3 Dmytro Morgun 2015-07-07 09:12:14 UTC
Created attachment 116992 [details]
patch for SplashFontEngine.cc unref is back to windows

It leaked under windows without this unref and works fine (at least for some fonts) with it.
Comment 4 Albert Astals Cid 2015-07-14 22:27:07 UTC
i have no way to test this, so i'll just trust you

Pushed
Comment 5 Dmytro Morgun 2015-07-15 08:09:59 UTC
Thanks. I'm quite confident it at least will not make things worse. I'd like to help if something will go wrong, but I'm unlikely to monitor poppler bugs, just will stay subscribed to this.


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.