dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0002-ui-gtk-fix-crash-when-terminal-inner-border-is-NULL.patch

35faab
From: Cole Robinson <crobinso@redhat.com>
35faab
Date: Thu, 5 May 2016 19:39:38 -0400
35faab
Subject: [PATCH] ui: gtk: fix crash when terminal inner-border is NULL
35faab
35faab
VTE terminal inner-border can be NULL. The vte-0.36 (API 2.90)
35faab
code checks for the condition too so I assume it's not just a bug
35faab
35faab
Fixes a crash on Fedora 24 with gtk 3.20
35faab
---
35faab
 ui/gtk.c | 10 ++++++----
35faab
 1 file changed, 6 insertions(+), 4 deletions(-)
35faab
35faab
diff --git a/ui/gtk.c b/ui/gtk.c
35faab
index f372a6d..9876d89 100644
35faab
--- a/ui/gtk.c
35faab
+++ b/ui/gtk.c
35faab
@@ -340,10 +340,12 @@ static void gd_update_geometry_hints(VirtualConsole *vc)
35faab
         geo.min_height = geo.height_inc * VC_TERM_Y_MIN;
35faab
         mask |= GDK_HINT_MIN_SIZE;
35faab
         gtk_widget_style_get(vc->vte.terminal, "inner-border", &ib, NULL);
35faab
-        geo.base_width  += ib->left + ib->right;
35faab
-        geo.base_height += ib->top + ib->bottom;
35faab
-        geo.min_width   += ib->left + ib->right;
35faab
-        geo.min_height  += ib->top + ib->bottom;
35faab
+        if (ib) {
35faab
+            geo.base_width  += ib->left + ib->right;
35faab
+            geo.base_height += ib->top + ib->bottom;
35faab
+            geo.min_width   += ib->left + ib->right;
35faab
+            geo.min_height  += ib->top + ib->bottom;
35faab
+        }
35faab
         geo_widget = vc->vte.terminal;
35faab
 #endif
35faab
     }