Skip to content

Commit

Permalink
video: gc2145: fix set_fmt()
Browse files Browse the repository at this point in the history
Trivial fix for bound check

Signed-off-by: Martino Facchin <[email protected]>
  • Loading branch information
facchinm authored and mmahadevan108 committed Nov 22, 2024
1 parent b4035e8 commit 054d60f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/gc2145.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ static int gc2145_set_fmt(const struct device *dev, enum video_endpoint_id ep,
}

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

0 comments on commit 054d60f

Please sign in to comment.