Skip to content

Commit 82d2f94

Browse files
josuahkartben
authored andcommitted
drivers: video: sw_generator: fix video_sw_generator_enum_frmival()
Return an error on fie.index >= 1 as there is only one framerate entry per pixelformat, this prevents an endless loop. Signed-off-by: Josuah Demangeon <me@josuah.net>
1 parent ba5d3ba commit 82d2f94

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/video/video_sw_generator.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ static int video_sw_generator_enum_frmival(const struct device *dev, struct vide
276276
size_t idx;
277277
int ret;
278278

279+
if (fie->index >= 1) {
280+
return -ERANGE;
281+
}
282+
279283
ret = video_format_caps_index(fmts, fie->format, &idx);
280284
if (ret < 0) {
281285
LOG_ERR("Unsupported pixel format or resolution");

0 commit comments

Comments
 (0)