[gimp] libgimpcolor: return NULL GimpColorTransform if creating cmsHTRANSFORM fails



commit d8271ed33faf0b175ba33dff9089d446ed6d8cfa
Author: Michael Natterer <mitch gimp org>
Date:   Mon May 30 10:58:48 2016 +0200

    libgimpcolor: return NULL GimpColorTransform if creating cmsHTRANSFORM fails

 libgimpcolor/gimpcolortransform.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/libgimpcolor/gimpcolortransform.c b/libgimpcolor/gimpcolortransform.c
index b966dbc..2cf7de4 100644
--- a/libgimpcolor/gimpcolortransform.c
+++ b/libgimpcolor/gimpcolortransform.c
@@ -200,6 +200,12 @@ gimp_color_transform_new (GimpColorProfile         *src_profile,
                                         rendering_intent,
                                         flags | cmsFLAGS_NOOPTIMIZE);
 
+  if (! priv->transform)
+    {
+      g_object_unref (transform);
+      transform = NULL;
+    }
+
   return transform;
 }
 
@@ -264,6 +270,12 @@ gimp_color_transform_new_proofing (GimpColorProfile         *src_profile,
                                                 display_intent,
                                                 flags | cmsFLAGS_SOFTPROOFING);
 
+  if (! priv->transform)
+    {
+      g_object_unref (transform);
+      transform = NULL;
+    }
+
   return transform;
 }
 


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