[poppler] poppler/poppler: SplashOutputDev.cc,1.9,1.10

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Jul 30 02:38:30 PDT 2006


Update of /cvs/poppler/poppler/poppler
In directory kemper:/tmp/cvs-serv10350/poppler

Modified Files:
	SplashOutputDev.cc 
Log Message:
        * splash/SplashFontEngine.cc:
        * poppler/SplashOutputDev.cc: Fix memory leak when using embedded
        fonts in the pdf file. Patch by Krzysztof Kowalczyk


Index: SplashOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/SplashOutputDev.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- SplashOutputDev.cc	31 May 2006 20:14:04 -0000	1.9
+++ SplashOutputDev.cc	30 Jul 2006 09:38:28 -0000	1.10
@@ -947,7 +947,7 @@
   GfxFontType fontType;
   SplashOutFontFileID *id;
   SplashFontFile *fontFile;
-  SplashFontSrc *fontsrc;
+  SplashFontSrc *fontsrc = NULL;
   FoFiTrueType *ff;
   Ref embRef;
   Object refObj, strObj;
@@ -1022,7 +1022,7 @@
     if (fileName)
       fontsrc->setFile(fileName, gFalse);
     else
-      fontsrc->setBuf(tmpBuf, tmpBufLen, gFalse);
+      fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
 
     // load the font file
     switch (fontType) {
@@ -1170,11 +1170,15 @@
   }
   font = fontEngine->getFont(fontFile, mat);
 
+  if (fontsrc)
+      fontsrc->unref();
   return;
 
  err2:
   delete id;
  err1:
+  if (fontsrc)
+      fontsrc->unref();
   return;
 }
 



More information about the poppler mailing list