[gtk+] image: Don't assume baseline parameters are non-NULL
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] image: Don't assume baseline parameters are non-NULL
- Date: Mon, 21 Dec 2015 17:55:23 +0000 (UTC)
commit 3075dac106a551591363e3f84026697c41a94a2a
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Dec 21 12:53:05 2015 -0500
image: Don't assume baseline parameters are non-NULL
The GetSize callback *can* assume that minimum and natural are
non-NULL. Buy minimum_baseline and natural_baseline can and
will be NULL, so handle that. This was causing crashes e.g. in
pavucontrol.
gtk/gtkimage.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index c9b454c..f9bd7e1 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1694,7 +1694,10 @@ gtk_image_get_content_size (GtkCssGadget *gadget,
{
baseline_align = gtk_image_get_baseline_align (GTK_IMAGE (widget));
*minimum = *natural = height;
- *minimum_baseline = *natural_baseline = height * baseline_align;
+ if (minimum_baseline)
+ *minimum_baseline = height * baseline_align;
+ if (natural_baseline)
+ *natural_baseline = height * baseline_align;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]