From b9ea2eb1236eb841d08a6ad76b4396d1a6d76cff Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Thu, 15 Aug 2019 17:49:12 +0900 Subject: [PATCH] d3dvideosink: Fix crash on WinProc handler ... caused by null pointer dereference. The d3dvideosink object might not available yet on the handler. --- sys/d3dvideosink/d3dhelpers.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/d3dvideosink/d3dhelpers.c b/sys/d3dvideosink/d3dhelpers.c index a145f535f..f6a7b8dc0 100644 --- a/sys/d3dvideosink/d3dhelpers.c +++ b/sys/d3dvideosink/d3dhelpers.c @@ -2046,6 +2046,11 @@ d3d_wnd_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) WNDPROC proc; LRESULT ret = 0; + /* d3dvideosink object might not available yet. + * The thread for message queue starts earlier than SetProp... */ + if (!sink) + return DefWindowProc (hWnd, message, wParam, lParam); + LOCK_SINK (sink); proc = sink->d3d.orig_wnd_proc; UNLOCK_SINK (sink); -- 2.34.1