protect against broken fonts
authorkramm <kramm>
Tue, 2 Dec 2008 17:09:37 +0000 (17:09 +0000)
committerkramm <kramm>
Tue, 2 Dec 2008 17:09:37 +0000 (17:09 +0000)
lib/pdf/InfoOutputDev.cc

index a10f4bd..d9336b2 100644 (file)
@@ -165,8 +165,12 @@ void InfoOutputDev::updateFont(GfxState *state)
     state->setFont(font, 1024.0);
     splash->doUpdateFont(state);
     currentfont->splash_font = splash->getCurrentFont();
-    currentfont->ascender = currentfont->splash_font->ascender;
-    currentfont->descender = currentfont->splash_font->descender;
+    if(currentfont->splash_font) {
+        currentfont->ascender = currentfont->splash_font->ascender;
+        currentfont->descender = currentfont->splash_font->descender;
+    } else {
+        currentfont->ascender = currentfont->descender = 0;
+    }
     free(id);
 }