From f397c7898781fb87dd51d7ba3106c12e8c51059e Mon Sep 17 00:00:00 2001 From: kramm Date: Tue, 21 Sep 2004 13:03:45 +0000 Subject: [PATCH] added fix for segfault. --- pdf2swf/xpdf/FoFiType1C.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pdf2swf/xpdf/FoFiType1C.cc b/pdf2swf/xpdf/FoFiType1C.cc index 91a21ad..a1cec31 100644 --- a/pdf2swf/xpdf/FoFiType1C.cc +++ b/pdf2swf/xpdf/FoFiType1C.cc @@ -231,8 +231,11 @@ void FoFiType1C::convertToType1(char **newEncoding, GBool ascii, (*outputFunc)(outputStream, "0 1 255 {1 index exch /.notdef put} for\n", 40); enc = newEncoding ? newEncoding : encoding; + if(!enc) { + fprintf(stderr, "convertToType1: Warning: No Encoding\n"); + } for (i = 0; i < 256; ++i) { - if (enc[i]) { + if (enc && enc[i]) { sprintf(buf, "dup %d /%s put\n", i, enc[i]); (*outputFunc)(outputStream, buf, strlen(buf)); } -- 1.7.10.4