[gegl] gegl: gegl_path_get_bounds handle NULL args



commit 4e14a7c0aeac4d531b010354fde80dd4ea610182
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue May 21 01:40:08 2019 +0200

    gegl: gegl_path_get_bounds handle NULL args

 gegl/property-types/gegl-path.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/gegl/property-types/gegl-path.c b/gegl/property-types/gegl-path.c
index 9fe4edc64..d28d1f87f 100644
--- a/gegl/property-types/gegl-path.c
+++ b/gegl/property-types/gegl-path.c
@@ -577,10 +577,17 @@ gegl_path_get_bounds (GeglPath *self,
                       gdouble  *min_y,
                       gdouble  *max_y)
 {
+  gdouble dummy;
   GeglPathPrivate *priv;
   GeglPathList    *iter;
   gboolean         first_point = TRUE;
 
+  /* protecting against NULL arguments */
+  if (!min_x) min_x = &dummy;
+  if (!max_x) max_x = &dummy;
+  if (!min_y) min_y = &dummy;
+  if (!max_y) max_y = &dummy;
+
   *min_x = 0.0;
   *min_y = 0.0;
   *max_x = 0.0;


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