summaryrefslogtreecommitdiffstats
path: root/hw/display/vmware_vga.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/display/vmware_vga.c')
-rw-r--r--hw/display/vmware_vga.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 63a7c05512..a26e62ea8b 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -563,7 +563,10 @@ static inline int vmsvga_fifo_length(struct vmsvga_state_s *s)
if (CMD(min) < (uint8_t *) s->cmd->fifo - (uint8_t *) s->fifo) {
return 0;
}
- if (CMD(max) > SVGA_FIFO_SIZE) {
+ if (CMD(max) > SVGA_FIFO_SIZE ||
+ CMD(min) >= SVGA_FIFO_SIZE ||
+ CMD(stop) >= SVGA_FIFO_SIZE ||
+ CMD(next_cmd) >= SVGA_FIFO_SIZE) {
return 0;
}
if (CMD(max) < CMD(min) + 10 * 1024) {