[gtk+] render: Fix uninitialized variables



commit ccf6507f6a1380ef1902dfbc4da3836580aea83f
Author: Benjamin Otte <otte redhat com>
Date:   Wed Oct 15 02:08:02 2014 +0200

    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

 gtk/gtkrender.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c
index 4fef314..d33d1fb 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 &&


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