diff options
author | Benjamin Otte <otte@redhat.com> | 2014-10-15 02:08:02 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2014-10-15 02:16:24 +0200 |
commit | ccf6507f6a1380ef1902dfbc4da3836580aea83f (patch) | |
tree | a3560f6b8ccfec48aea54e4c78573c9dd4900dfa /gtk/gtkrender.c | |
parent | c184bd46758a49f1a6453966cd4428a00a55f785 (diff) | |
download | gtk+-ccf6507f6a1380ef1902dfbc4da3836580aea83f.tar.gz |
render: Fix uninitialized variables
Refactoring for performance in 39097ea2da79fa1ce79fb291dc5588260e992a5f
caused border_width to be uninitialized when rendering border images.
https://bugzilla.gnome.org/show_bug.cgi?id=738483
Diffstat (limited to 'gtk/gtkrender.c')
-rw-r--r-- | gtk/gtkrender.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c index 4fef314cf6..d33d1fb330 100644 --- a/gtk/gtkrender.c +++ b/gtk/gtkrender.c @@ -894,10 +894,12 @@ render_frame_internal (GtkStyleContext *context, GtkJunctionSides junction) { GtkBorderImage border_image; - GtkBorderStyle border_style[4]; - GtkRoundedBox border_box; double border_width[4]; - GdkRGBA colors[4]; + + border_width[0] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100); + border_width[1] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100); + border_width[2] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100); + border_width[3] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100); if (_gtk_border_image_init (&border_image, context)) { @@ -905,10 +907,9 @@ render_frame_internal (GtkStyleContext *context, } else { - border_width[0] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100); - border_width[1] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100); - border_width[2] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100); - border_width[3] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100); + GtkBorderStyle border_style[4]; + GtkRoundedBox border_box; + GdkRGBA colors[4]; /* Optimize the most common case of "This widget has no border" */ if (border_width[0] == 0 && |