patch-2.4.8 linux/drivers/usb/ibmcam.c

Next file: linux/drivers/usb/ov511.c
Previous file: linux/drivers/sound/via82cxxx_audio.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.7/linux/drivers/usb/ibmcam.c linux/drivers/usb/ibmcam.c
@@ -2591,11 +2591,11 @@
 		{
 			struct video_window vw;
 
+			memset(&vw, 0, sizeof(vw));
 			vw.x = 0;
 			vw.y = 0;
 			vw.width = imgwidth;
 			vw.height = imgheight;
-			vw.chromakey = 0;
 			vw.flags = usb_ibmcam_calculate_fps();
 
 			if (copy_to_user(arg, &vw, sizeof(vw)))
@@ -2658,6 +2658,11 @@
 			if (copy_from_user((void *)&frame, arg, sizeof(int)))
 				return -EFAULT;
 
+			if ((unsigned)frame >= IBMCAM_NUMFRAMES) {
+				err("VIDIOCSYNC: invalid frame %d.", frame);
+				return -EINVAL;
+			}
+
 			if (debug >= 1)
 				printk(KERN_DEBUG "ibmcam: syncing to frame %d\n", frame);
 
@@ -3161,5 +3166,3 @@
 
 MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
-
-

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)