75a61b
From 9e9df4b20d17478996780008bc9802a857d173fc Mon Sep 17 00:00:00 2001
75a61b
From: Albert Astals Cid <aacid@kde.org>
75a61b
Date: Thu, 8 Jan 2015 17:01:52 +0100
75a61b
Subject: Fix crash on broken document
75a61b
75a61b
Bug #85281
75a61b
75a61b
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
75a61b
index 359c0d6..b439942 100644
75a61b
--- a/poppler/GfxState.cc
75a61b
+++ b/poppler/GfxState.cc
75a61b
@@ -16,7 +16,7 @@
75a61b
 // Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
75a61b
 // Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net>
75a61b
 // Copyright (C) 2006, 2010 Carlos Garcia Campos <carlosgc@gnome.org>
75a61b
-// Copyright (C) 2006-2014 Albert Astals Cid <aacid@kde.org>
75a61b
+// Copyright (C) 2006-2015 Albert Astals Cid <aacid@kde.org>
75a61b
 // Copyright (C) 2009, 2012 Koji Otani <sho@bbr.jp>
75a61b
 // Copyright (C) 2009, 2011-2013 Thomas Freitag <Thomas.Freitag@alfa.de>
75a61b
 // Copyright (C) 2009 Christian Persch <chpe@gnome.org>
75a61b
@@ -3048,8 +3048,12 @@ GfxColorSpace *GfxDeviceNColorSpace::copy() {
75a61b
   int *mappingA = NULL;
75a61b
 
75a61b
   GooList *sepsCSA = new GooList(sepsCS->getLength());
75a61b
-  for (i = 0; i < sepsCS->getLength(); i++)
75a61b
-    sepsCSA->append(((GfxSeparationColorSpace *) sepsCS->get(i))->copy());
75a61b
+  for (i = 0; i < sepsCS->getLength(); i++) {
75a61b
+    GfxSeparationColorSpace *scs = (GfxSeparationColorSpace *) sepsCS->get(i);
75a61b
+    if (scs != NULL) {
75a61b
+      sepsCSA->append(scs->copy());
75a61b
+    }
75a61b
+  }
75a61b
   if (mapping != NULL) {
75a61b
     mappingA = (int *)gmalloc(sizeof(int) * nComps);
75a61b
     for (i = 0; i < nComps; i++)
75a61b
-- 
75a61b
cgit v0.10.2
75a61b