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: e1a5873701 ("test: camera: Add buffer import and mapping test")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi 2019-09-16 11:54:13 +02:00
parent a422b30939
commit 0f2e8cac8d

View file

@ -28,6 +28,11 @@ static constexpr unsigned int CAMERA_BUFFER_COUNT = 4;
class FrameSink class FrameSink
{ {
public: public:
FrameSink()
: video_(nullptr)
{
}
int init() int init()
{ {
int ret; int ret;