Jinjie Ruan d2842dec57 media: gspca: ov534-ov772x: Fix off-by-one error in set_frame_rate()
In set_frame_rate(), select a rate in rate_0 or rate_1 by checking
sd->frame_rate >= r->fps in a loop, but the loop condition terminates when
the index reaches zero, which fails to check the last elememt in rate_0 or
rate_1.

Check for >= 0 so that the last one in rate_0 or rate_1 is also checked.

Fixes: 189d92af707e ("V4L/DVB (13422): gspca - ov534: ov772x changes from Richard Kaswy.")
Cc: stable@vger.kernel.org
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2024-11-07 09:05:57 +01:00
..
2024-05-03 11:13:45 +01:00
2021-04-09 13:19:38 +02:00
2022-03-18 05:58:35 +01:00
2019-08-19 12:10:47 -03:00
2022-03-12 16:59:52 +01:00
2020-08-29 08:35:27 +02:00
2019-08-19 12:10:47 -03:00
2019-08-19 12:10:47 -03:00
2019-08-19 12:10:47 -03:00
2019-08-19 12:10:47 -03:00
2019-08-19 12:10:47 -03:00
2019-08-19 12:10:47 -03:00