From 61e2828036c89bb074b00f50c3bf48257bcfa9c0 Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Mon, 1 May 2017 19:29:41 +0200 Subject: [PATCH] win-ivcam: Fix potential null pointer dereference --- plugins/win-ivcam/realsense.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/win-ivcam/realsense.cpp b/plugins/win-ivcam/realsense.cpp index 6ac4ffc05..4395df5e5 100644 --- a/plugins/win-ivcam/realsense.cpp +++ b/plugins/win-ivcam/realsense.cpp @@ -107,6 +107,12 @@ struct IVCamSource { void IVCamSource::CamThread() { pSegServer = SegServer::CreateServer(); + + if (!pSegServer) { + warn("SegServer::CreateServer failed\n"); + return; + } + SegServer::ServiceStatus status = pSegServer->Init(); if (status != SegServer::ServiceStatus::SERVICE_NO_ERROR) {