]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
console: fix dpy_gfx_replace_surface assert
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 6 Sep 2017 14:21:09 +0000 (16:21 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 22 Sep 2017 23:13:37 +0000 (18:13 -0500)
virtio-gpu can trigger the assert added by commit "6905b93447 console:
add same surface replace pre-condition" in multihead setups (where
surface can be NULL for secondary displays).  Allow surface being NULL.

Fixes: 6905b93447a42e606dfd126b90f75f4cd3c6fe94
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20170906142109.2685-1-kraxel@redhat.com
(cherry picked from commit 1540008629bbb6a9c0826582d94ecf7a559f784c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
ui/console.c

index d2d3534c4929ff55e9411ec8c104b9c7269d4c16..f0292d7820e81c0d533371323770d287dc69e492 100644 (file)
@@ -1540,7 +1540,7 @@ void dpy_gfx_replace_surface(QemuConsole *con,
     DisplaySurface *old_surface = con->surface;
     DisplayChangeListener *dcl;
 
-    assert(old_surface != surface);
+    assert(old_surface != surface || surface == NULL);
 
     con->surface = surface;
     QLIST_FOREACH(dcl, &s->listeners, next) {