mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-15 00:19:44 +03:00
android: generic_camera_buffer: Fix bufferLength_ initialization
The bufferLength_ member variabled is checked to have a positive value
before being used, to catch usage before the variable is set. The
variable is initialized to zero at construction time, which renders the
checks useless.
Fix this by initializing the variable to -1 at construction time.
Fixes: c5e2ed7806
("android: camera_buffer: Map buffer in the first plane() call")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
88009711be
commit
1c877bd868
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,
|
|||
buffer_handle_t camera3Buffer,
|
||||
libcamera::PixelFormat pixelFormat,
|
||||
const libcamera::Size &size, int flags)
|
||||
: fd_(-1), flags_(flags), bufferLength_(0), mapped_(false)
|
||||
: fd_(-1), flags_(flags), bufferLength_(-1), mapped_(false)
|
||||
{
|
||||
error_ = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue