Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] ov9650: off by one in ov965x_enum_frame_sizes()

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>

authored by

Dan Carpenter and committed by
Mauro Carvalho Chehab
6a4760ed 174e60ad

+1 -1
+1 -1
drivers/media/i2c/ov9650.c
··· 1083 1083 { 1084 1084 int i = ARRAY_SIZE(ov965x_formats); 1085 1085 1086 - if (fse->index > ARRAY_SIZE(ov965x_framesizes)) 1086 + if (fse->index >= ARRAY_SIZE(ov965x_framesizes)) 1087 1087 return -EINVAL; 1088 1088 1089 1089 while (--i)