From fe0b15f5d5c1045fd82cf372cb40a1f3fed8f876 Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 19 May 2002 11:25:00 +0000 Subject: [PATCH] fix segfault in case of unimplemented function type. --- pdf2swf/xpdf/GfxState.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pdf2swf/xpdf/GfxState.cc b/pdf2swf/xpdf/GfxState.cc index 1abf9a5..b7afdae 100644 --- a/pdf2swf/xpdf/GfxState.cc +++ b/pdf2swf/xpdf/GfxState.cc @@ -912,14 +912,15 @@ GfxColorSpace *GfxSeparationColorSpace::parse(Array *arr) { obj1.free(); func = Function::parse(arr->get(3, &obj1)); obj1.free(); - if (!func->isOk()) { + if (!func || !func->isOk()) { goto err4; } cs = new GfxSeparationColorSpace(name, alt, func); return cs; err4: - delete func; + if(func) + delete func; delete alt; err3: delete name; -- 1.7.10.4