[vlc-commits] direct3d11: fix potential NULL dereference

Steve Lhomme git at videolan.org
Fri Apr 27 15:33:04 CEST 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Apr 26 16:02:05 2018 +0200| [2dff06bed79ca2748cf1df67ae147f9bc1fc7b20] | committer: Hugo Beauzée-Luyssen

direct3d11: fix potential NULL dereference

(cherry picked from commit 1a5afc2114e88556054feea1c1102287f21dad93)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=2dff06bed79ca2748cf1df67ae147f9bc1fc7b20
---

 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 b428a147dc..ca9d2bf314 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -2205,8 +2205,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