]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[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 1dbb8118a285e6247cda883e40ff0bfedaf36f04..4da90c621f7ed0b80fe668a0aeadcb936f5baf25 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)