From f53ac8d57c9496993e468bd838e74eb64ca498c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 12 Jul 2025 18:24:44 +0200 Subject: [PATCH] spa: libcamera: source: handle camera acquire failure Check the return value of `Camera::acquire()` and return the error if that fails. --- spa/plugins/libcamera/libcamera-source.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spa/plugins/libcamera/libcamera-source.cpp b/spa/plugins/libcamera/libcamera-source.cpp index d23b033f0..0d094bd57 100644 --- a/spa/plugins/libcamera/libcamera-source.cpp +++ b/spa/plugins/libcamera/libcamera-source.cpp @@ -211,7 +211,9 @@ int spa_libcamera_open(struct impl *impl) return 0; spa_log_info(impl->log, "open camera %s", impl->device_id.c_str()); - impl->camera->acquire(); + + if (int res = impl->camera->acquire(); res < 0) + return res; impl->allocator = new FrameBufferAllocator(impl->camera);