aboutsummaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/vesa.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/isa/vesa.c')
-rw-r--r--sys/i386/isa/vesa.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c
index 3fc68afb0651..630501c0526a 100644
--- a/sys/i386/isa/vesa.c
+++ b/sys/i386/isa/vesa.c
@@ -1317,7 +1317,9 @@ get_palette(video_adapter_t *adp, int base, int count,
int bits;
int error;
- if ((base < 0) || (base >= 256) || (base + count > 256))
+ if ((base < 0) || (base >= 256) || (count < 0) || (count > 256))
+ return 1;
+ if (base + count > 256)
return 1;
if (!(vesa_adp_info->v_flags & V_DAC8) || !VESA_MODE(adp->va_mode))
return 1;