qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Cole Robinson <crobinso@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 01/12] ui: gtk: fix crash when terminal inner-border is NULL
Date: Tue, 10 May 2016 07:51:46 +0200	[thread overview]
Message-ID: <1462859517-30207-2-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1462859517-30207-1-git-send-email-kraxel@redhat.com>

From: Cole Robinson <crobinso@redhat.com>

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 <crobinso@redhat.com>
Message-id: 2b2e85d403e8760ea53afd735a170500d5c17716.1462557436.git.crobinso@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 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
     }
-- 
1.8.3.1

  reply	other threads:[~2016-05-10  5:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10  5:51 [Qemu-devel] [PULL 00/12] ui patch queue Gerd Hoffmann
2016-05-10  5:51 ` Gerd Hoffmann [this message]
2016-05-10  5:51 ` [Qemu-devel] [PULL 02/12] ui: sdl2: Release grab before opening console window Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 03/12] configure: build SDL if only SDL2 available Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 04/12] configure: error on unknown --with-sdlabi value Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 05/12] configure: add echo_version helper Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 06/12] configure: report GTK version Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 07/12] configure: report SDL version Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 08/12] configure: support vte-2.91 Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 09/12] ui: gtk: Fix a runtime warning on vte >= 0.37 Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 10/12] ui: gtk: Fix some deprecation warnings Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 11/12] ui/gtk: copy to clipboard support Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 12/12] spice/gl: add & use qemu_spice_gl_monitor_config Gerd Hoffmann
2016-05-10 14:08 ` [Qemu-devel] [PULL 00/12] ui patch queue Cole Robinson
2016-05-12 13:26 ` Peter Maydell
2016-05-12 13:57   ` Gerd Hoffmann
2016-05-13  7:56     ` Gerd Hoffmann
2016-05-13 10:13       ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462859517-30207-2-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=crobinso@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).