From 7008e76c625e4a8caf7ad8b8079552e80b73ad7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Polomsk=C3=BD?= <1155369-polomsky@users.noreply.gitlab.freedesktop.org> Date: Mon, 25 Nov 2024 15:47:22 +0100 Subject: [PATCH] v4l2object: Fixed incorrect maximum value for int range There are objects where maximum is not multiplication of the step, e.g. there was a combination where max was 65535 with step 2. Part-of: --- subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c index 6fc027d87d..ca3977b11b 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c @@ -2894,7 +2894,11 @@ gst_v4l2_object_probe_caps_for_format (GstV4l2Object * v4l2object, maxw = MIN (size.stepwise.max_width, G_MAXINT); maxh = MIN (size.stepwise.max_height, G_MAXINT); - /* FIXME: check for sanity and that min/max are multiples of the steps */ + /* ensure maxes are multiples of the steps */ + maxw -= maxw % step_w; + maxh -= maxh % step_h; + + /* FIXME: check for sanity */ /* we only query details for the min width/height in order to allow for a big range of frameintervals.