summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarnabás Pőcze <pobrn@protonmail.com>2025-01-06 10:06:16 +0000
committerBarnabás Pőcze <pobrn@protonmail.com>2025-01-10 12:14:27 +0100
commitfd6e41b9fb32b54f6811898f824fe50b918d82eb (patch)
tree94c6257a1583620cf6c1eeaf0d5e20154ebd4289 /src
parentd49a84a4f3aa63efc900564ff32558e4f5d85b04 (diff)
gstreamer: allocator: gst_libcamera_allocator_new(): Recognize errors
`FrameBufferAllocator::allocate()` might return a negative error code, but currently this is handled the same way as success. So instead of continuing, abort the construction of the allocator object. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Diffstat (limited to 'src')
-rw-r--r--src/gstreamer/gstlibcameraallocator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp
index 7e4c904d..b0c84893 100644
--- a/src/gstreamer/gstlibcameraallocator.cpp
+++ b/src/gstreamer/gstlibcameraallocator.cpp
@@ -214,7 +214,7 @@ gst_libcamera_allocator_new(std::shared_ptr<Camera> camera,
Stream *stream = streamCfg.stream();
ret = self->fb_allocator->allocate(stream);
- if (ret == 0)
+ if (ret <= 0)
return nullptr;
GQueue *pool = g_queue_new();