Skip to content

Commit 054d60f

Browse files
facchinmmmahadevan108
authored andcommitted
video: gc2145: fix set_fmt()
Trivial fix for bound check Signed-off-by: Martino Facchin <[email protected]>
1 parent b4035e8 commit 054d60f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/video/gc2145.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ static int gc2145_set_fmt(const struct device *dev, enum video_endpoint_id ep,
10391039
}
10401040

10411041
/* Check if camera is capable of handling given format */
1042-
for (int i = 0; i == ARRAY_SIZE(fmts); i++) {
1042+
for (int i = 0; i < RESOLUTIONS_MAX; i++) {
10431043
if (fmts[i].width_min == fmt->width && fmts[i].height_min == fmt->height &&
10441044
fmts[i].pixelformat == fmt->pixelformat) {
10451045
res = (enum resolutions)i;

0 commit comments

Comments
 (0)