[media] ov9650: off by one in ov965x_enum_frame_sizes()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Aug 2013 08:33:48 +0000 (05:33 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sat, 24 Aug 2013 07:54:17 +0000 (04:54 -0300)
The ">" should be ">=" otherwise we read one space beyond the end of the
array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/i2c/ov9650.c

index 1dbb811..4da90c6 100644 (file)
@@ -1083,7 +1083,7 @@ static int ov965x_enum_frame_sizes(struct v4l2_subdev *sd,
 {
        int i = ARRAY_SIZE(ov965x_formats);
 
-       if (fse->index > ARRAY_SIZE(ov965x_framesizes))
+       if (fse->index >= ARRAY_SIZE(ov965x_framesizes))
                return -EINVAL;
 
        while (--i)