widget: Fix priv dereference in size_allocate_with_baseline

Accessing ->priv is only safe *after* the GTK_IS_WIDGET precondition, so
use the get_instance_private function instead.
This commit is contained in:
Timm Bäder 2017-07-09 16:42:19 +02:00 committed by Matthias Clasen
parent 6d9a0d432a
commit 2e6b1158ee

View File

@ -5381,7 +5381,7 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
GtkAllocation *allocation,
gint baseline)
{
GtkWidgetPrivate *priv;
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
GdkRectangle real_allocation;
GdkRectangle old_allocation, old_clip;
GdkRectangle adjusted_allocation;
@ -5395,8 +5395,6 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
GtkCssStyle *style;
GtkBorder margin, border, padding;
priv = widget->priv;
g_return_if_fail (GTK_IS_WIDGET (widget));
if (!priv->visible && !_gtk_widget_is_toplevel (widget))