Commit a265d8f3 authored by Philip Withnall's avatar Philip Withnall

gtkmenu: Fix potential use of uninitialised variables

The child_height out variable is only valid if compute_child_offset()
returns TRUE.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
parent 480a0050
......@@ -5414,9 +5414,9 @@ gtk_menu_real_move_scroll (GtkMenu *menu,
{
gint child_height;
compute_child_offset (menu, menu_shell->priv->active_menu_item,
&child_offset, &child_height, NULL);
child_offset += child_height / 2;
if (compute_child_offset (menu, menu_shell->priv->active_menu_item,
&child_offset, &child_height, NULL))
child_offset += child_height / 2;
}
menu_shell->priv->ignore_enter = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment