[gegl] crop: do not relay source_bounding_box if 0



commit 580feef28fb5132174507f9a6229542596c798ac
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Feb 27 22:30:17 2017 +0100

    crop: do not relay source_bounding_box if 0

 operations/core/crop.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/operations/core/crop.c b/operations/core/crop.c
index 1af88ff..6ad286e 100644
--- a/operations/core/crop.c
+++ b/operations/core/crop.c
@@ -96,7 +96,11 @@ gegl_crop_get_bounding_box (GeglOperation *operation)
   result.width  = o->width;
   result.height = o->height;
 
-  gegl_rectangle_intersect (&result, &result, in_rect);
+  /* in_rect sometimes ends up as 0,0,0,0 and in those cases - other
+   * code ends up seg-faulting
+   */
+  if (in_rect->width != 0 && in_rect->height != 0)
+    gegl_rectangle_intersect (&result, &result, in_rect);
 
   return result;
 }


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