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
This commit is contained in:
Jasper St. Pierre 2011-10-12 21:15:36 -04:00
parent b9069df85c
commit cecb1a41fb

View File

@ -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,