From 03a292cd62cd8df8ed3e1e0cae62b284c2ee9a6c Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 4 Apr 2012 12:10:21 +0100 Subject: [PATCH] Fixed missing error check when setting ICC profile. --- ghostscript-icc-missing-check.patch | 30 +++++++++++++++++++++++++++++ ghostscript.spec | 9 ++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 ghostscript-icc-missing-check.patch diff --git a/ghostscript-icc-missing-check.patch b/ghostscript-icc-missing-check.patch new file mode 100644 index 0000000..0bf2f1f --- /dev/null +++ b/ghostscript-icc-missing-check.patch @@ -0,0 +1,30 @@ +diff -up ghostscript-9.05/base/gsicc_manage.c.icc-missing-check ghostscript-9.05/base/gsicc_manage.c +--- ghostscript-9.05/base/gsicc_manage.c.icc-missing-check 2012-02-08 08:48:48.000000000 +0000 ++++ ghostscript-9.05/base/gsicc_manage.c 2012-04-04 12:39:29.151888287 +0100 +@@ -140,6 +140,8 @@ gsicc_set_iccsmaskprofile(const char *pn + if (str != NULL) { + icc_profile = gsicc_profile_new(str, mem, pname, namelen); + code = sfclose(str); ++ } ++ if (str != NULL && icc_profile != NULL) { + /* Get the profile handle */ + icc_profile->profile_handle = + gsicc_get_profile_handle_buffer(icc_profile->buffer, +@@ -517,6 +519,8 @@ gsicc_set_srcgtag_struct(gsicc_manager_t + icc_profile = + gsicc_profile_new(str, mem, curr_ptr, strlen(curr_ptr)); + code = sfclose(str); ++ } ++ if (str != NULL && icc_profile != NULL) { + gsicc_init_profile_info(icc_profile); + break; + } else { +@@ -1127,6 +1131,8 @@ gsicc_set_device_profile(gx_device * pde + icc_profile = + gsicc_profile_new(str, mem, file_name, strlen(file_name)); + code = sfclose(str); ++ } ++ if (str != NULL && icc_profile != NULL) { + if (pro_enum < gsPROOFPROFILE) { + if_debug1(gs_debug_flag_icc, "[icc] Setting device profile %d\n", pro_enum); + pdev->icc_struct->device_profile[pro_enum] = icc_profile; diff --git a/ghostscript.spec b/ghostscript.spec index 0552259..212d783 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer Name: ghostscript Version: %{gs_ver} -Release: 2%{?dist} +Release: 3%{?dist} # Included CMap data is Redistributable, no modification permitted, # see http://bugzilla.redhat.com/487510 @@ -21,6 +21,7 @@ Patch2: ghostscript-scripts.patch Patch3: ghostscript-noopt.patch Patch4: ghostscript-ijs-automake-ver.patch Patch5: ghostscript-runlibfileifexists.patch +Patch6: ghostscript-icc-missing-check.patch Patch10: ghostscript-cups-filters.patch Patch27: ghostscript-Fontmap.local.patch Patch28: ghostscript-iccprofiles-initdir.patch @@ -118,6 +119,9 @@ rm -rf libpng zlib jpeg jasper expat # Define .runlibfileifexists. %patch5 -p1 +# Fixed missing error check when setting ICC profile. +%patch6 -p1 -b .icc-missing-check + # Install CUPS filter convs files in the correct place. %patch10 -p1 -b .cups-filters @@ -323,6 +327,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgs.so %changelog +* Wed Apr 4 2012 Tim Waugh - 9.05-3 +- Fixed missing error check when setting ICC profile. + * Thu Apr 26 2012 Jon Ciesla - 9.05-2 - Fixed encodings and changelog version for merge review BZ 225795.