fix segfault in case of unimplemented function type.
authorkramm <kramm>
Sun, 19 May 2002 11:25:00 +0000 (11:25 +0000)
committerkramm <kramm>
Sun, 19 May 2002 11:25:00 +0000 (11:25 +0000)
pdf2swf/xpdf/GfxState.cc

index 1abf9a5..b7afdae 100644 (file)
@@ -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;