Message ID | 20240310143023.752559-4-pobrn@protonmail.com |
---|---|
State | Accepted |
Commit | 2e2ba223f3a249f1c04fe88c2709ca6e7d42c242 |
Headers | show |
Series |
|
Related | show |
Quoting Barnabás Pőcze (2024-03-10 14:30:43) > 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> > --- > src/libcamera/framebuffer_allocator.cpp | 4 ++++ > 1 file changed, 4 insertions(+) > > 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); > + Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > return ret; > } > > -- > 2.44.0 > >
Hi Barnabás On Sun, Mar 10, 2024 at 02:30:43PM +0000, Barnabás Pőcze wrote: > 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: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Thanks j > --- > src/libcamera/framebuffer_allocator.cpp | 4 ++++ > 1 file changed, 4 insertions(+) > > 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; > } > > -- > 2.44.0 > >
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; }
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> --- src/libcamera/framebuffer_allocator.cpp | 4 ++++ 1 file changed, 4 insertions(+)