[gnome-photos] gegl-gtk-view-helper: Fix crash when setting autoscale without a node



commit a94b15cc86bac78099656a9e93a40b6a03fad16d
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jan 22 20:13:15 2015 +0100

    gegl-gtk-view-helper: Fix crash when setting autoscale without a node
    
    From gegl-gtk commit 8d92c7b97c6874941282f789e6f6c320290e5297
    
    Fixes: https://bugzilla.gnome.org/731437

 src/gegl-gtk-view-helper.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/gegl-gtk-view-helper.c b/src/gegl-gtk-view-helper.c
index 4d0afa9..a89a4ba 100644
--- a/src/gegl-gtk-view-helper.c
+++ b/src/gegl-gtk-view-helper.c
@@ -132,11 +132,14 @@ static void
 update_autoscale(ViewHelper *self)
 {
     GdkRectangle viewport = self->widget_allocation;
-    GeglRectangle bbox = gegl_node_get_bounding_box(self->node);
-    model_rect_to_view_rect(self, &bbox);
+    GeglRectangle bbox;
+
+    if (!self->node || viewport.width < 0 || viewport.height < 0)
+        return;
 
-    if (!self->node || viewport.width < 0 || viewport.height < 0
-            || bbox.width < 0 || bbox.height < 0)
+    bbox = gegl_node_get_bounding_box(self->node);
+    model_rect_to_view_rect(self, &bbox);
+    if (bbox.width < 0 || bbox.height < 0)
         return;
 
     if (self->autoscale_policy == GEGL_GTK_VIEW_AUTOSCALE_WIDGET) {


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