[gimp/soc-2011-seamless-clone2] app: set error in case of error in ICC profile plug-in



commit 343854cf39a5a1db8290b8d8579f17d2b7a64838
Author: Nils Philippsen <nils 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.

 app/plug-in/plug-in-icc-profile.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/app/plug-in/plug-in-icc-profile.c b/app/plug-in/plug-in-icc-profile.c
index f23c477..f7446e1 100644
--- a/app/plug-in/plug-in-icc-profile.c
+++ b/app/plug-in/plug-in-icc-profile.c
@@ -71,7 +71,12 @@ plug_in_icc_profile_apply_rgb (GimpImage     *image,
   gimp = image->gimp;
 
   if (gimp_image_get_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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]