[gegl] gegl_color_get_rgba: check for NULL in pointer args



commit 305067386d51dcf2c17d6e9de36bf5a679b87980
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Mar 29 18:46:23 2016 +0200

    gegl_color_get_rgba: check for NULL in pointer args

 gegl/property-types/gegl-color.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gegl/property-types/gegl-color.c b/gegl/property-types/gegl-color.c
index a362926..6880136 100644
--- a/gegl/property-types/gegl-color.c
+++ b/gegl/property-types/gegl-color.c
@@ -310,10 +310,10 @@ gegl_color_get_rgba (GeglColor *self,
 {
   g_return_if_fail (GEGL_IS_COLOR (self));
 
-  *r = self->priv->rgba_color[0];
-  *g = self->priv->rgba_color[1];
-  *b = self->priv->rgba_color[2];
-  *a = self->priv->rgba_color[3];
+  if (r) *r = self->priv->rgba_color[0];
+  if (g) *g = self->priv->rgba_color[1];
+  if (b) *b = self->priv->rgba_color[2];
+  if (a) *a = self->priv->rgba_color[3];
 }
 
 static void


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