Fixed missing error check when setting ICC profile.

This commit is contained in:
Tim Waugh 2012-04-04 12:10:21 +01:00
parent a317f6b732
commit 03a292cd62
2 changed files with 38 additions and 1 deletions

View File

@ -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;

View File

@ -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 <twaugh@redhat.com> - 9.05-3
- Fixed missing error check when setting ICC profile.
* Thu Apr 26 2012 Jon Ciesla <limburgher@gmail.com> - 9.05-2
- Fixed encodings and changelog version for merge review BZ 225795.