mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2026-01-06 09:14:57 +00:00
window: Fix segault on zooming operations
When virt-viewer is "Waiting for guest domain to start" and the Ctrl- or Ctrl+ keys are pressed to zoom the blank display virt-viewer will crash in virt_viewer_display_get_desktop_size because of a NULL display pointer. To reproduce start virt-viewer on a VM not running and zoom the display. Signed-off-by: Charles Arnold <carnold@suse.com> Acked-by: Fabiano Fidêncio <fidencio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
parent
18e0fa27e3
commit
b64b58b971
@ -378,6 +378,8 @@ virt_viewer_window_get_real_zoom_level(VirtViewerWindow *self)
|
||||
GtkAllocation allocation;
|
||||
guint width, height;
|
||||
|
||||
g_return_val_if_fail(self->priv->display != NULL, 100);
|
||||
|
||||
gtk_widget_get_allocation(GTK_WIDGET(self->priv->display), &allocation);
|
||||
virt_viewer_display_get_desktop_size(self->priv->display, &width, &height);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user