[gimp] app: fix setting a NULL profile with gimp_image_set_color_profile()



commit acb76a4d2a8a4e772e075ae8e2e7b9bb5a0a1a69
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jun 7 01:37:55 2015 +0200

    app: fix setting a NULL profile with gimp_image_set_color_profile()

 app/core/gimpimage-profile.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/app/core/gimpimage-profile.c b/app/core/gimpimage-profile.c
index 8cceaa6..03136d1 100644
--- a/app/core/gimpimage-profile.c
+++ b/app/core/gimpimage-profile.c
@@ -172,16 +172,18 @@ gimp_image_set_color_profile (GimpImage         *image,
                                     GIMP_PARASITE_UNDOABLE,
                                     length, data);
       g_free (data);
-    }
 
-  if (! gimp_image_validate_icc_profile (image, parasite, error))
-    {
-      gimp_parasite_free (parasite);
-      return FALSE;
+      if (! gimp_image_validate_icc_profile (image, parasite, error))
+        {
+          gimp_parasite_free (parasite);
+          return FALSE;
+        }
     }
 
   gimp_image_set_icc_profile (image, parasite);
-  gimp_parasite_free (parasite);
+
+  if (parasite)
+    gimp_parasite_free (parasite);
 
   return FALSE;
 }


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