[poppler] poppler/TextOutputDev.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Oct 12 05:20:56 PDT 2008


 poppler/TextOutputDev.cc |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 00f9995b4960575cd1f392474c585f2140c8e587
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Oct 12 14:20:01 2008 +0200

    Do not crash if there is not font
    
    See bug 18023 for more info

diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index e5ce643..85a9dbf 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -1941,6 +1941,7 @@ void TextPage::updateFont(GfxState *state) {
 }
 
 void TextPage::beginWord(GfxState *state, double x0, double y0) {
+  GfxFont *gfxFont;
   double *fontm;
   double m[4], m2[4];
   int rot;
@@ -1955,7 +1956,8 @@ void TextPage::beginWord(GfxState *state, double x0, double y0) {
 
   // compute the rotation
   state->getFontTransMat(&m[0], &m[1], &m[2], &m[3]);
-  if (state->getFont()->getType() == fontType3) {
+  gfxFont = state->getFont();
+  if (gfxFont && gfxFont->getType() == fontType3) {
     fontm = state->getFont()->getFontMatrix();
     m2[0] = fontm[0] * m[0] + fontm[1] * m[2];
     m2[1] = fontm[0] * m[1] + fontm[1] * m[3];


More information about the poppler mailing list