]> Git Repo - qemu.git/commitdiff
virtio-gpu: add sanity check
authorGerd Hoffmann <[email protected]>
Mon, 27 May 2019 09:12:26 +0000 (11:12 +0200)
committerGerd Hoffmann <[email protected]>
Tue, 28 May 2019 06:14:44 +0000 (08:14 +0200)
Require a minimum 16x16 size for the scanout, to make sure the guest
can't set either width or height to zero.  This (a) doesn't make sense
at all and (b) causes problems in some UI code.  When using spice this
will triggers an assert().

Reported-by: Tyler Slabinski <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Marc-AndrĂ© Lureau <[email protected]>
Message-id: 20190527091226[email protected]

hw/display/virtio-gpu.c

index 9e37e0ac96b77a4620ff38785bce8bd971564295..372b31ef0af2a500a67b0854b1bfaaf9f063d15a 100644 (file)
@@ -677,6 +677,8 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g,
 
     if (ss.r.x > res->width ||
         ss.r.y > res->height ||
+        ss.r.width < 16 ||
+        ss.r.height < 16 ||
         ss.r.width > res->width ||
         ss.r.height > res->height ||
         ss.r.x + ss.r.width > res->width ||
This page took 0.03026 seconds and 4 git commands to generate.