diff -r ccf09ef4a983 gspca_core.c
--- a/gspca_core.c	Thu Aug 09 09:04:45 2007 +0200
+++ b/gspca_core.c	Thu Aug 09 09:20:25 2007 +0200
@@ -1195,7 +1195,7 @@ spca5xx_getcapability(struct usb_spca50x
 	minw = minh = 255 * 255;
 	maxw = maxh = 0;
 	for (i = QCIF; i < TOTMODE; i++) {
-		if (spca50x->mode_cam[i].width) {
+		if (spca50x->mode_cam[i].width && spca50x->mode_cam[i].method == 0) {
 			if (maxw < spca50x->mode_cam[i].width
 			    || maxh < spca50x->mode_cam[i].height) {
 				maxw = spca50x->mode_cam[i].width;
@@ -1288,7 +1288,8 @@ spca5xx_setMode(struct usb_spca50x *spca
 	for (i = QCIF; i < TOTMODE; i++) {
 		if ((spca50x->mode_cam[i].width == width) &&
 		    (spca50x->mode_cam[i].height == height) &&
-		    (spca50x->mode_cam[i].t_palette & formatIn)) {
+		    (spca50x->mode_cam[i].t_palette & formatIn) &&
+		    (spca50x->mode_cam[i].method == 0)) {
 			spca50x->width = spca50x->mode_cam[i].width;
 			spca50x->height = spca50x->mode_cam[i].height;
 			spca50x->pipe_size = spca50x->mode_cam[i].pipe;
@@ -1321,6 +1322,8 @@ spca5xx_setMode(struct usb_spca50x *spca
 			break;
 		}
 	}			// end match mode
+	if (i == TOTMODE)
+		return -EINVAL;
 /* initialize the hdrwidth and hdrheight for the first init_source */
 /* precompute the crop x y value for each frame */
 	if (!spca50x->method) {
@@ -2015,6 +2018,8 @@ spca5xx_testPalSize(struct usb_spca50x *
 		return -EINVAL;
 	if ((needsize = wxh_to_size(w, h)) < 0)
 		return -EINVAL;
+	if (spca50x->mode_cam[needsize].method != 0)
+	  	return -EINVAL;
 	if (!(spca50x->mode_cam[needsize].t_palette & needpalette))
 		return -EINVAL;
 	return 0;
