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>
This commit is contained in:
Barnabás Pőcze 2025-01-06 10:06:16 +00:00
parent d49a84a4f3
commit fd6e41b9fb

View file

@ -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();