From a79941501716eb65e6d905d2430bddf48887f3f5 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Wed, 7 May 2025 23:06:48 +0200 Subject: apps: qcam: Push the viewfinder role to vector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit ee2b011b65c6 ("apps: cam: Try raw role if default viewfinder role fails"), the viewfinder role is specified as the default if no role is yet chosen. This was unfortunately added by directly accessing the vector rather than extending the size when the vector is empty. Fix the code to push the default viewfinder role on to the back of the vector, increasing the size appropriately. Fixes: ee2b011b65c6 ("apps: cam: Try raw role if default viewfinder role fails") Signed-off-by: Kieran Bingham Reviewed-by: Barnabás Pőcze Tested-by: Barnabás Pőcze Reviewed-by: Paul Elder Signed-off-by: Kieran Bingham --- src/apps/qcam/main_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp index 224a7e5a..7e3f3da6 100644 --- a/src/apps/qcam/main_window.cpp +++ b/src/apps/qcam/main_window.cpp @@ -357,7 +357,7 @@ int MainWindow::startCapture() /* Verify roles are supported. */ switch (roles.size()) { case 0: - roles[0] = StreamRole::Viewfinder; + roles.push_back(StreamRole::Viewfinder); break; case 1: if (roles[0] != StreamRole::Viewfinder) { -- cgit v1.2.1