Blame SOURCES/ghostscript-icc-missing-check.patch

c9d7fc
diff -up ghostscript-9.07/base/gsicc_manage.c.icc-missing-check ghostscript-9.07/base/gsicc_manage.c
c9d7fc
--- ghostscript-9.07/base/gsicc_manage.c.icc-missing-check	2013-02-14 07:58:13.000000000 +0000
c9d7fc
+++ ghostscript-9.07/base/gsicc_manage.c	2013-02-14 17:15:48.974654828 +0000
c9d7fc
@@ -144,6 +144,8 @@ gsicc_set_iccsmaskprofile(const char *pn
c9d7fc
     if (str != NULL) {
c9d7fc
         icc_profile = gsicc_profile_new(str, mem, pname, namelen);
c9d7fc
         code = sfclose(str);
c9d7fc
+    }
c9d7fc
+    if (str != NULL && icc_profile != NULL) {
c9d7fc
         /* Get the profile handle */
c9d7fc
         icc_profile->profile_handle =
c9d7fc
             gsicc_get_profile_handle_buffer(icc_profile->buffer,
c9d7fc
@@ -593,6 +595,8 @@ gsicc_set_srcgtag_struct(gsicc_manager_t
c9d7fc
                             icc_profile =
c9d7fc
                                 gsicc_profile_new(str, mem, curr_ptr, strlen(curr_ptr));
c9d7fc
                             code = sfclose(str);
c9d7fc
+                        }
c9d7fc
+                        if (str != NULL && icc_profile != NULL) {
c9d7fc
                             gsicc_init_profile_info(icc_profile);
c9d7fc
                             cmm = gsCMM_DEFAULT;
c9d7fc
                             /* Check if this object is a devicelink profile. 
c9d7fc
@@ -1516,6 +1520,8 @@ gsicc_set_device_profile(gx_device * pde
c9d7fc
             icc_profile =
c9d7fc
                 gsicc_profile_new(str, mem, file_name, strlen(file_name));
c9d7fc
             code = sfclose(str);
c9d7fc
+        }
c9d7fc
+        if (str != NULL && icc_profile != NULL) {
c9d7fc
             if (pro_enum < gsPROOFPROFILE) {
c9d7fc
                 if_debug1m(gs_debug_flag_icc, mem,
c9d7fc
                            "[icc] Setting device profile %d\n", pro_enum);