[gimp] don't crash upon not applying a color profile to a grayscale image

Nils Philippsen nphilipp at fedoraproject.org
Wed May 29 15:03:55 UTC 2013


commit 6b3cc130fbe465992607f48b2cc3a84cb7519b42
Author: Nils Philippsen <nils at redhat.com>
Date:   Wed May 29 15:50:14 2013 +0200

    don't crash upon not applying a color profile to a grayscale image
    
    (#922622)

 gimp-2.8.4-color-profile-crash.patch |   46 ++++++++++++++++++++++++++++++++++
 gimp.spec                            |    7 ++++-
 2 files changed, 52 insertions(+), 1 deletions(-)
---
diff --git a/gimp-2.8.4-color-profile-crash.patch b/gimp-2.8.4-color-profile-crash.patch
new file mode 100644
index 0000000..556d74b
--- /dev/null
+++ b/gimp-2.8.4-color-profile-crash.patch
@@ -0,0 +1,46 @@
+From 230cdd4e3890b44ca6dd8147609016b15c91eb9a Mon Sep 17 00:00:00 2001
+From: Nils Philippsen <nils at redhat.com>
+Date: Wed, 29 May 2013 15:35:12 +0200
+Subject: [PATCH] patch: color-profile-crash
+
+Squashed commit of the following:
+
+commit 3328d54954cfcdc403cdfe167f969a5edb248bc1
+Author: Nils Philippsen <nils at redhat.com>
+Date:   Mon Mar 18 13:37:17 2013 +0100
+
+    app: set error in case of error in ICC profile plug-in
+
+    The function plug_in_icc_profile_apply_rgb() didn't set the error object
+    when bailing out due to being called on a grayscale image, this could
+    lead to crashes in callers which just checked the return value, but not
+    whether or not an error had been set.
+    (cherry picked from commit 096c636b67abd7967da645699948c2bd3f8273fb)
+
+    Conflicts:
+    	app/plug-in/plug-in-icc-profile.c
+---
+ app/plug-in/plug-in-icc-profile.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/app/plug-in/plug-in-icc-profile.c b/app/plug-in/plug-in-icc-profile.c
+index 268b5b8..cc5ec79 100644
+--- a/app/plug-in/plug-in-icc-profile.c
++++ b/app/plug-in/plug-in-icc-profile.c
+@@ -69,7 +69,12 @@ plug_in_icc_profile_apply_rgb (GimpImage     *image,
+   gimp = image->gimp;
+ 
+   if (gimp_image_base_type (image) == GIMP_GRAY)
+-    return FALSE;
++    {
++      g_set_error (error, GIMP_PLUG_IN_ERROR, GIMP_PLUG_IN_EXECUTION_FAILED,
++                   _("Can't apply color profile to grayscale image (%s)"),
++                   ICC_PROFILE_APPLY_RGB_PROC);
++      return FALSE;
++    }
+ 
+   procedure = gimp_pdb_lookup_procedure (gimp->pdb, ICC_PROFILE_APPLY_RGB_PROC);
+ 
+-- 
+1.8.1.4
+
diff --git a/gimp.spec b/gimp.spec
index eeef0dc..6296322 100644
--- a/gimp.spec
+++ b/gimp.spec
@@ -223,6 +223,9 @@ Patch6:         gimp-2.8.4-unsharp-mask-crash.patch
 # Fix crashes when selecting text with multiple colors etc.
 # Upstream commit 44be26742ce317132687f78434e75e5b15f245cd
 Patch7:         gimp-2.8.4-text-selection-crash.patch
+# Don't crash upon not applying a color profile to a grayscale image.
+# Upstream commit 15b88af4f11e556a1c30cd5bc447bb0c7c24d3c6
+Patch8:         gimp-2.8.4-color-profile-crash.patch
 
 %description
 GIMP (GNU Image Manipulation Program) is a powerful image composition and
@@ -316,6 +319,7 @@ EOF
 %patch5 -p1 -b .script-fu-gradient
 %patch6 -p1 -b .unsharp-mask-crash
 %patch7 -p1 -b .text-selection-crash
+%patch8 -p1 -b .color-profile-crash
 
 %build
 %if %{with hardening}
@@ -620,12 +624,13 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 %endif
 
 %changelog
-* Mon May 27 2013 Nils Philippsen <nils at redhat.com>
+* Wed May 29 2013 Nils Philippsen <nils at redhat.com>
 - fix upstream commit ids
 - fix double-free crashes when selecting gradients from script-fu (#964470)
 - fix crash in unsharp-mask plug-in (#966987)
 - hardcode python interpreter in python plug-ins (#952227)
 - fix crash when selecting text with multiple colors etc. (#919795, #951815)
+- don't crash upon not applying a color profile to a grayscale image (#922622)
 
 * Sat Apr 20 2013 Nils Philippsen <nils at redhat.com> - 2:2.8.4-3
 - don't crash upon deleting tags in popup (#892828)


More information about the scm-commits mailing list