From 3223ebf85298888a0bda5a489e78584baafa151f Mon Sep 17 00:00:00 2001
From: kramm <kramm>
Date: Mon, 20 Dec 2004 18:21:04 +0000
Subject: [PATCH] fixed page52.pdf segfault (added null pointer handling to
 SWFOutputDev::writeEmbeddedFontToFile)

---
 pdf2swf/SWFOutputDev.cc |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc
index 770af0c..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);
-- 
1.7.10.4