[gimp/gimp-2-8] app: set error in case of error in ICC profile plug-in



commit 15b88af4f11e556a1c30cd5bc447bb0c7c24d3c6
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.
    (cherry picked from commit 096c636b67abd7967da645699948c2bd3f8273fb)
    
    Conflicts:
        app/plug-in/plug-in-icc-profile.c

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


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