mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
gtk: fix unchecked vc dereference
Spotted by Coverity. Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1463737748-1062-1-git-send-email-kraxel@redhat.com
This commit is contained in:
parent
daafc661cc
commit
41cc5239f3
1 changed files with 2 additions and 1 deletions
3
ui/gtk.c
3
ui/gtk.c
|
@ -1477,13 +1477,14 @@ static void gd_grab_pointer(VirtualConsole *vc, const char *reason)
|
||||||
static void gd_ungrab_pointer(GtkDisplayState *s)
|
static void gd_ungrab_pointer(GtkDisplayState *s)
|
||||||
{
|
{
|
||||||
VirtualConsole *vc = s->ptr_owner;
|
VirtualConsole *vc = s->ptr_owner;
|
||||||
GdkDisplay *display = gtk_widget_get_display(vc->gfx.drawing_area);
|
GdkDisplay *display;
|
||||||
|
|
||||||
if (vc == NULL) {
|
if (vc == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
s->ptr_owner = NULL;
|
s->ptr_owner = NULL;
|
||||||
|
|
||||||
|
display = gtk_widget_get_display(vc->gfx.drawing_area);
|
||||||
#if GTK_CHECK_VERSION(3, 20, 0)
|
#if GTK_CHECK_VERSION(3, 20, 0)
|
||||||
gd_grab_update(vc, vc->s->kbd_owner == vc, false);
|
gd_grab_update(vc, vc->s->kbd_owner == vc, false);
|
||||||
gdk_device_warp(gd_get_pointer(display),
|
gdk_device_warp(gd_get_pointer(display),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue