summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Carlon <carlon.luca@gmail.com>2020-10-18 12:59:08 +0200
committerLuca Carlon <carlon.luca@gmail.com>2020-10-20 08:48:34 +0200
commitc6e934601a3405f80c601aac207b09588e291b89 (patch)
treedf779eb1c33ab13d435c6f8a3ef890f5e10d873a
parente4580277115ea89ca5b885108702d3d64dbea427 (diff)
Fix nullptr dereference in directshow plugin
Init pointer before trying to dereference it in directshow plugin. This fixes a crash trying to play a video when QT_DIRECTSHOW_NO_EVR is set. Change-Id: Ie42eff035bd7fe173ca629c68b1228dc760c717d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/plugins/directshow/common/directshowmediatypeenum.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/directshow/common/directshowmediatypeenum.cpp b/src/plugins/directshow/common/directshowmediatypeenum.cpp
index 0ff147fea..02281bb98 100644
--- a/src/plugins/directshow/common/directshowmediatypeenum.cpp
+++ b/src/plugins/directshow/common/directshowmediatypeenum.cpp
@@ -42,7 +42,8 @@
#include "directshowpin.h"
DirectShowMediaTypeEnum::DirectShowMediaTypeEnum(DirectShowPin *pin)
- : m_mediaTypes(pin->supportedMediaTypes())
+ : m_pin(pin)
+ , m_mediaTypes(pin->supportedMediaTypes())
{
m_pin->AddRef();
}