summaryrefslogtreecommitdiff
path: root/test/camera
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-09-16 11:54:13 +0200
committerJacopo Mondi <jacopo@jmondi.org>2019-09-16 22:21:27 +0200
commit0f2e8cac8dd43544adad50bf42b0fda496ddb055 (patch)
treec72079d78a1cfce5cddfe96b93dc9e03777fed0d /test/camera
parenta422b3093912edf564a670f6861299ba03ccf724 (diff)
test: buffer_import: Initialize video_ to nullptr
When the vivid module used to test buffer importing is not loaded, the test correctly bails out, but during the clean up procedure tries to access the video_ field, which, if not correctly initialized to nullptr contains random values and accessing it causes a segfault. Fix this by initializing video_ field to nullptr to make sure it is properly handled in cleanup(). Fixes: e1a5873701a9 ("test: camera: Add buffer import and mapping test") Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'test/camera')
-rw-r--r--test/camera/buffer_import.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp
index 9364e3d1..9cac19d8 100644
--- a/test/camera/buffer_import.cpp
+++ b/test/camera/buffer_import.cpp
@@ -28,6 +28,11 @@ static constexpr unsigned int CAMERA_BUFFER_COUNT = 4;
class FrameSink
{
public:
+ FrameSink()
+ : video_(nullptr)
+ {
+ }
+
int init()
{
int ret;