[vlc-commits] direct3d11: fix potential NULL dereference

Steve Lhomme git at videolan.org
Thu Apr 26 16:07:32 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Apr 26 16:02:05 2018 +0200| [1a5afc2114e88556054feea1c1102287f21dad93] | committer: Steve Lhomme

direct3d11: fix potential NULL dereference

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a5afc2114e88556054feea1c1102287f21dad93
---

 modules/video_output/win32/direct3d11.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index d089ede339..90cfa918b9 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -2210,8 +2210,11 @@ static int Direct3D11CreateGenericResources(vout_display_t *vd)
         hr = CompilePixelShader(vd, sys->d3dregion_format, TRANSFER_FUNC_SRGB, true, &sys->pSPUPixelShader);
         if (FAILED(hr))
         {
-            ID3D11PixelShader_Release(sys->picQuadPixelShader);
-            sys->picQuadPixelShader = NULL;
+            if (sys->picQuadPixelShader)
+            {
+                ID3D11PixelShader_Release(sys->picQuadPixelShader);
+                sys->picQuadPixelShader = NULL;
+            }
             msg_Err(vd, "Failed to create the SPU pixel shader. (hr=0x%lX)", hr);
             return VLC_EGENERIC;
         }



More information about the vlc-commits mailing list