summary refs log tree commit diff stats
path: root/ui/console.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-08-30 13:38:12 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-09-04 14:01:52 +0400
commit0a1642e7ccdadf6c3da670369eeceec410dce058 (patch)
tree66902b75feed52a86d06e5e517e79c0735711dc0 /ui/console.c
parentb704a8ce0c17f2f9f50a62cbe9053ef587c35db4 (diff)
downloadfocaccia-qemu-0a1642e7ccdadf6c3da670369eeceec410dce058.tar.gz
focaccia-qemu-0a1642e7ccdadf6c3da670369eeceec410dce058.zip
ui/console: assert(surface) where appropriate
The QemuTextConsole code paths assume a surface is being used as
scanout, let's make this more explicit.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-39-marcandre.lureau@redhat.com>
Diffstat (limited to 'ui/console.c')
-rw-r--r--ui/console.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/console.c b/ui/console.c
index a157a5b31c..04ec2d2488 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -339,6 +339,7 @@ static void qemu_console_fill_rect(QemuConsole *con, int posx, int posy,
         .x = posx, .y = posy, .width = width, .height = height
     };
 
+    assert(surface);
     pixman_image_fill_rectangles(PIXMAN_OP_SRC, surface->image,
                                  &color, 1, &rect);
 }
@@ -349,6 +350,7 @@ static void qemu_console_bitblt(QemuConsole *con,
 {
     DisplaySurface *surface = qemu_console_surface(con);
 
+    assert(surface);
     pixman_image_composite(PIXMAN_OP_SRC,
                            surface->image, NULL, surface->image,
                            xs, ys, 0, 0, xd, yd, w, h);
@@ -392,6 +394,7 @@ static void vga_putcharxy(QemuConsole *s, int x, int y, int ch,
     DisplaySurface *surface = qemu_console_surface(s);
     pixman_color_t fgcol, bgcol;
 
+    assert(surface);
     if (t_attrib->invers) {
         bgcol = color_table_rgb[t_attrib->bold][t_attrib->fgcol];
         fgcol = color_table_rgb[t_attrib->bold][t_attrib->bgcol];
@@ -519,6 +522,7 @@ static void console_refresh(QemuTextConsole *s)
     TextCell *c;
     int x, y, y1;
 
+    assert(surface);
     s->text_x[0] = 0;
     s->text_y[0] = 0;
     s->text_x[1] = s->width - 1;