From a858290e4bb1cdd8198ebf95390bbcefabd2cb82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Wed, 23 Jul 2025 13:01:21 +0200 Subject: [PATCH] spa: libcamera: source: avoid iterator overrun when enumerating controls Do not overrun the iterator when skipping the initial couple items. --- spa/plugins/libcamera/libcamera-source.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/libcamera/libcamera-source.cpp b/spa/plugins/libcamera/libcamera-source.cpp index d0be3aac2..228a12e87 100644 --- a/spa/plugins/libcamera/libcamera-source.cpp +++ b/spa/plugins/libcamera/libcamera-source.cpp @@ -774,7 +774,7 @@ spa_libcamera_enum_controls(struct impl *impl, struct port *port, int seq, result.next = start; auto it = info.begin(); - for (skip = result.next - offset; skip; skip--) + for (skip = result.next - offset; skip && it != info.end(); skip--) it++; if (false) {