From: Seungha Yang Date: Thu, 15 Aug 2019 08:49:12 +0000 (+0900) Subject: d3dvideosink: Fix crash on WinProc handler X-Git-Tag: 1.16.2~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9ea2eb1236eb841d08a6ad76b4396d1a6d76cff;p=platform%2Fupstream%2Fgst-plugins-bad.git d3dvideosink: Fix crash on WinProc handler ... caused by null pointer dereference. The d3dvideosink object might not available yet on the handler. --- 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);