Commit 7e078153c7 for qemu.org

commit 7e078153c7a8c54a487bbe980bfa98284cc60929
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date:   Sun Oct 4 14:23:28 2026 +0400

    ui/console: skip empty update regions in qemu_console_update

    After clamping coordinates to the surface dimensions, the resulting
    width or height can be zero. Proceeding with such values would pass
    degenerate rectangles to display listeners. Return early to avoid
    useless work.

    Fixes: 7c20b4a374d0 ("console: fix displaychangelisteners interface")
    Reported-by: Hui Peng <benquike@gmail.com>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-ID: <20261004-issue-4560-v1-14-ccbef537cbeb@redhat.com>

diff --git a/ui/console.c b/ui/console.c
index 14f148118e..795c9857de 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -740,6 +740,9 @@ void qemu_console_update(QemuConsole *con, int x, int y, int w, int h)
     y = MIN(y, height);
     w = MIN(w, width - x);
     h = MIN(h, height - y);
+    if (w <= 0 || h <= 0) {
+        return;
+    }

     dpy_gfx_update_texture(con, con->surface, x, y, w, h);
     QLIST_FOREACH(dcl, &s->listeners, next) {