[gnome-shell] st-texture-cache: Fix a minor crash when computing our border-radius



commit cecb1a41fbe7b549d864c71d72cad72181ccf050
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Oct 12 21:15:36 2011 -0400

    st-texture-cache: Fix a minor crash when computing our border-radius
    
    If we add a 0-sized actor with a border-radius, we will crash as we try to
    allocate a 0-sized texture in Cogl. Bail out early instead of doing that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=661617

 src/st/st-theme-node-drawing.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c
index b4d9e90..440ca13 100644
--- a/src/st/st-theme-node-drawing.c
+++ b/src/st/st-theme-node-drawing.c
@@ -342,12 +342,13 @@ st_theme_node_lookup_corner (StThemeNode    *node,
   StCornerSpec corner;
   guint radius[4];
 
-  if (node->border_radius[corner_id] == 0)
-    return COGL_INVALID_HANDLE;
-
   cache = st_texture_cache_get_default ();
 
   st_theme_node_reduce_border_radius (node, radius);
+
+  if (radius[corner_id] == 0)
+    return COGL_INVALID_HANDLE;
+
   corner.radius = radius[corner_id];
   corner.color = node->background_color;
   st_theme_node_get_corner_border_widths (node, corner_id,



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