libcamera: software_isp: Replace malloc() with std::vector<>

libcamera is implemented in C++, use std::vector<> to manage the
dynamically allocated line buffers instead of malloc() and free(). This
simplifies the code and improves memory safety by ensuring no allocation
will be leaked.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Laurent Pinchart
2024-08-04 00:09:14 +03:00
parent 46275401e6
commit 57396a0e3f
2 changed files with 13 additions and 20 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ private:
DebayerInputConfig inputConfig_;
DebayerOutputConfig outputConfig_;
std::unique_ptr<SwStatsCpu> stats_;
uint8_t *lineBuffers_[kMaxLineBuffers];
std::vector<uint8_t> lineBuffers_[kMaxLineBuffers];
unsigned int lineBufferLength_;
unsigned int lineBufferPadding_;
unsigned int lineBufferIndex_;