[libcamera-devel] [PATCH] libcamera: control_serializer: Initialize serial_
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Sat Jan 4 07:00:31 CET 2020
The ControlSerializer::serial_ member variable isn't initialized. Add a
constructor to the class to initialize it.
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
src/libcamera/control_serializer.cpp | 5 +++++
src/libcamera/include/control_serializer.h | 2 ++
2 files changed, 7 insertions(+)
diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp
index b787655e6769..a5d6d875c76f 100644
--- a/src/libcamera/control_serializer.cpp
+++ b/src/libcamera/control_serializer.cpp
@@ -84,6 +84,11 @@ static constexpr size_t ControlValueSize[] = {
* proceed with care to avoid stale references.
*/
+ControlSerializer::ControlSerializer()
+ : serial_(0)
+{
+}
+
/**
* \brief Reset the serializer
*
diff --git a/src/libcamera/include/control_serializer.h b/src/libcamera/include/control_serializer.h
index bb3cb8e7b904..55259913a2ca 100644
--- a/src/libcamera/include/control_serializer.h
+++ b/src/libcamera/include/control_serializer.h
@@ -20,6 +20,8 @@ class ByteStreamBuffer;
class ControlSerializer
{
public:
+ ControlSerializer();
+
void reset();
static size_t binarySize(const ControlInfoMap &info);
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list