summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarnabás Pőcze <pobrn@protonmail.com>2024-03-10 14:30:43 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2024-03-12 10:09:56 +0000
commit2e2ba223f3a249f1c04fe88c2709ca6e7d42c242 (patch)
treed2cc7ff08f1b7c1a52ae9daf8e94d5129cbbcd44 /src
parentab5816a5406c3e269a0a5449f682cc3be6a50a1b (diff)
libcamera: framebuffer_allocator: Remove entry if allocation fails
Remove the entry from the `buffers_` mapping if `Camera::exportFrameBuffers()` fails, otherwise there would be a stale entry in the map. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/framebuffer_allocator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcamera/framebuffer_allocator.cpp b/src/libcamera/framebuffer_allocator.cpp
index fc19a33a..dbd0db19 100644
--- a/src/libcamera/framebuffer_allocator.cpp
+++ b/src/libcamera/framebuffer_allocator.cpp
@@ -97,6 +97,10 @@ int FrameBufferAllocator::allocate(Stream *stream)
LOG(Allocator, Error)
<< "Stream is not part of " << camera_->id()
<< " active configuration";
+
+ if (ret < 0)
+ buffers_.erase(it);
+
return ret;
}