X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2FSWFOutputDev.cc;h=2728dcb24d87889f252dc3e0a713b89bdbfbef2e;hb=eea310f329b7409684f825c92a58dcc22b1de506;hp=eee568d43ec1f826a57f025dbc29a5e20508c879;hpb=74a954a873f7d9a9720ddd503f9de676cebb976b;p=swftools.git diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index eee568d..2728dcb 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -1261,9 +1261,11 @@ char*SWFOutputDev::writeEmbeddedFontToFile(XRef*ref, GfxFont*font) } #ifdef XPDF_101 Type1CFontFile *cvt = new Type1CFontFile(fontBuf, fontLen); + if(!cvt) return 0; cvt->convertToType1(f); #else FoFiType1C *cvt = FoFiType1C::make(fontBuf, fontLen); + if(!cvt) return 0; cvt->convertToType1(NULL, gTrue, FoFiWrite, f); #endif //cvt->convertToCIDType0("test", f); @@ -1449,6 +1451,10 @@ char* SWFOutputDev::substituteFont(GfxFont*gfxFont, char* oldname) fontname = "Times-Roman"; } filename = searchFont(fontname); + if(!filename) { + msg(" Couldn't find font %s- did you install the default fonts?"); + return 0; + } if(substitutepos>=sizeof(substitutesource)/sizeof(char*)) { msg(" Too many fonts in file.");