aboutsummaryrefslogtreecommitdiff
path: root/hw/display/vmware_vga.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-09-13 13:56:35 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-09-13 13:56:35 +0100
commitfa9701240951093907076db0943f96972a396ef5 (patch)
treef24ce2ffe6c7ac316e8e316d48f8bf77ff491c5f /hw/display/vmware_vga.c
parente1c270c9404efe47c94b944818fdd093e418f938 (diff)
parentc2843e93907a4084e91573994486e810cec248a0 (diff)
Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20160913-1' into staging
virtio-gpu and vmsvga fixes. # gpg: Signature made Tue 13 Sep 2016 09:14:44 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/pull-vga-20160913-1: virtio-vga: adapt to page-per-vq=off virtio-gpu-pci: tag as not hotpluggable vmsvga: correct bitmap and pixmap size checks Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/display/vmware_vga.c')
-rw-r--r--hw/display/vmware_vga.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index e51a05ea7e..6599cf078d 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -676,11 +676,13 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
cursor.bpp = vmsvga_fifo_read(s);
args = SVGA_BITMAP_SIZE(x, y) + SVGA_PIXMAP_SIZE(x, y, cursor.bpp);
- if (cursor.width > 256 ||
- cursor.height > 256 ||
- cursor.bpp > 32 ||
- SVGA_BITMAP_SIZE(x, y) > sizeof cursor.mask ||
- SVGA_PIXMAP_SIZE(x, y, cursor.bpp) > sizeof cursor.image) {
+ if (cursor.width > 256
+ || cursor.height > 256
+ || cursor.bpp > 32
+ || SVGA_BITMAP_SIZE(x, y)
+ > sizeof(cursor.mask) / sizeof(cursor.mask[0])
+ || SVGA_PIXMAP_SIZE(x, y, cursor.bpp)
+ > sizeof(cursor.image) / sizeof(cursor.image[0])) {
goto badcmd;
}