[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/10] ui: gtk: fix crash when terminal inner-border
From: |
Cole Robinson |
Subject: |
[Qemu-devel] [PATCH 01/10] ui: gtk: fix crash when terminal inner-border is NULL |
Date: |
Fri, 6 May 2016 14:03:05 -0400 |
VTE terminal inner-border can be NULL. The vte-0.36 (API 2.90)
code checks for the condition too so I assume it's not just a bug
Fixes a crash on Fedora 24 with gtk 3.20
Signed-off-by: Cole Robinson <address@hidden>
---
ui/gtk.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index f372a6d..9876d89 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -340,10 +340,12 @@ static void gd_update_geometry_hints(VirtualConsole *vc)
geo.min_height = geo.height_inc * VC_TERM_Y_MIN;
mask |= GDK_HINT_MIN_SIZE;
gtk_widget_style_get(vc->vte.terminal, "inner-border", &ib, NULL);
- geo.base_width += ib->left + ib->right;
- geo.base_height += ib->top + ib->bottom;
- geo.min_width += ib->left + ib->right;
- geo.min_height += ib->top + ib->bottom;
+ if (ib) {
+ geo.base_width += ib->left + ib->right;
+ geo.base_height += ib->top + ib->bottom;
+ geo.min_width += ib->left + ib->right;
+ geo.min_height += ib->top + ib->bottom;
+ }
geo_widget = vc->vte.terminal;
#endif
}
--
2.7.4
- [Qemu-devel] [PATCH 00/10] ui: gtk and sdl2 fixes, Cole Robinson, 2016/05/06
- [Qemu-devel] [PATCH 01/10] ui: gtk: fix crash when terminal inner-border is NULL,
Cole Robinson <=
- [Qemu-devel] [PATCH 05/10] configure: add echo_version helper, Cole Robinson, 2016/05/06
- [Qemu-devel] [PATCH 02/10] ui: sdl2: Release grab before opening console window, Cole Robinson, 2016/05/06
- [Qemu-devel] [PATCH 07/10] configure: report SDL version, Cole Robinson, 2016/05/06
- [Qemu-devel] [PATCH 06/10] configure: report GTK version, Cole Robinson, 2016/05/06
- [Qemu-devel] [PATCH 10/10] ui: gtk: Fix some deprecation warnings, Cole Robinson, 2016/05/06
- [Qemu-devel] [PATCH 03/10] configure: build SDL if only SDL2 available, Cole Robinson, 2016/05/06
- [Qemu-devel] [PATCH 08/10] configure: support vte-2.91, Cole Robinson, 2016/05/06
- [Qemu-devel] [PATCH 04/10] configure: error on unknown --with-sdlabi value, Cole Robinson, 2016/05/06
- [Qemu-devel] [PATCH 09/10] ui: gtk: Fix a runtime warning on vte >= 0.37, Cole Robinson, 2016/05/06