From c109dbef8cc11dd5de7292ba21c0628d1dc31857 Mon Sep 17 00:00:00 2001 From: kramm Date: Fri, 23 Nov 2001 16:45:53 +0000 Subject: [PATCH] * only store fonts with valid names in substitute table. * in updateFont, do return if we would call swfoutput_setfont with a negative t1id. --- pdf2swf/SWFOutputDev.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index 5d53fbd..41eda26 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -973,10 +973,12 @@ char* SWFOutputDev::substituteFont(GfxFont*gfxFont, char* oldname) logf(" Too many fonts in file."); exit(1); } - substitutesource[substitutepos] = oldname; - substitutetarget[substitutepos] = fontname; - logf(" substituting %s -> %s", oldname, fontname); - substitutepos ++; + if(oldname) { + substitutesource[substitutepos] = oldname; + substitutetarget[substitutepos] = fontname; + logf(" substituting %s -> %s", oldname, fontname); + substitutepos ++; + } return fontname; } @@ -1080,6 +1082,7 @@ void SWFOutputDev::updateFont(GfxState *state) if(t1id<0) { showFontError(gfxFont,0); + return; } /* we may have done some substitutions here, so check -- 1.7.10.4