d3dvideosink: Fix crash on WinProc handler

... caused by null pointer dereference. The d3dvideosink object might
not available yet on the handler.
This commit is contained in:
Seungha Yang 2019-08-15 17:49:12 +09:00
parent 58afcf09b4
commit 736df5604f

View file

@ -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);