changeset 3959:72d8a4d0de18

lastminute divbyzero fix by Attila Kinali ;)
author arpi
date Wed, 02 Jan 2002 23:38:16 +0000
parents 5e61815deced
children 79e1c3c0e634
files drivers/mga_vid.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/drivers/mga_vid.c	Wed Jan 02 23:22:33 2002 +0000
+++ b/drivers/mga_vid.c	Wed Jan 02 23:38:16 2002 +0000
@@ -607,6 +607,11 @@
 	printk(KERN_DEBUG "mga_vid: Setting up a %dx%d+%d+%d video window (src %dx%d) format %X\n",
 	       dw, dh, x, y, sw, sh, config->format);
 
+	if(sw<4 || sh<4 || dw<4 || dh<4){
+	    printk(KERN_ERR "mga_vid: Invalid src/dest dimenstions\n");
+	    return -1;
+	}
+
 	//FIXME check that window is valid and inside desktop
 	
 	//FIXME figure out a better way to allocate memory on card