summaryrefslogtreecommitdiff
path: root/gtk/gtkrenderborder.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-01-09 17:30:33 -0500
committerMatthias Clasen <mclasen@redhat.com>2016-01-09 23:44:43 -0500
commitcaaf537f94f0e03aabadef8c80a7a39dda02e2ff (patch)
tree1ee84e20400723a7bd1d7f48cb5668a51a68e013 /gtk/gtkrenderborder.c
parent7d0173763eb89f221636a07a28e45f9c29f8a069 (diff)
downloadgtk+-caaf537f94f0e03aabadef8c80a7a39dda02e2ff.tar.gz
Avoid division by 0 in the border rendering code
We skip sides with 0 border width in render_border, but when we collect sides with the same style, we may pass the 0 width down to render_frame_stroke anyway. So skip width 0 sides there as well.
Diffstat (limited to 'gtk/gtkrenderborder.c')
-rw-r--r--gtk/gtkrenderborder.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkrenderborder.c b/gtk/gtkrenderborder.c
index 22452d15cb..84f81428cf 100644
--- a/gtk/gtkrenderborder.c
+++ b/gtk/gtkrenderborder.c
@@ -518,11 +518,14 @@ render_frame_stroke (cairo_t *cr,
border_width[GTK_CSS_BOTTOM],
border_width[GTK_CSS_LEFT]);
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 4; i++)
{
if (hidden_side & (1 << i))
continue;
+ if (border_width[i] == 0)
+ continue;
+
cairo_save (cr);
if (i == 0)