From e770ed42c37f25ae1fa640f44ae109988131100a 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 fb986f09f..ee9adc6e2 100644 --- a/spa/plugins/libcamera/libcamera-source.cpp +++ b/spa/plugins/libcamera/libcamera-source.cpp @@ -773,7 +773,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) {