Fixed GtkCellRendererText invalid pointer access.

Fixed get_desired_size() to not access parameters when NULL and
also not to access priv->object if it hasnt yet been assigned.
This commit is contained in:
Tristan Van Berkom 2010-04-03 19:48:14 -04:00
parent 0fbdb3c73f
commit 894e887370

View File

@ -1946,6 +1946,9 @@ gtk_cell_renderer_text_extended_layout_get_desired_size (GtkExtendedLayout *layo
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (layout);
if (priv->owner)
{
if (minimal_size)
{
get_size (GTK_CELL_RENDERER (layout),
@ -1966,6 +1969,21 @@ gtk_cell_renderer_text_extended_layout_get_desired_size (GtkExtendedLayout *layo
priv->ellipsize = ellipsize;
}
}
else
{
if (minimal_size)
{
minimal_size->height = 0;
minimal_size->width = 0;
}
if (desired_size)
{
desired_size->height = 0;
desired_size->width = 0;
}
}
}
static void