[vlc-commits] direct3d9: gl: don't unlock if a previous lock failed

Thomas Guillem git at videolan.org
Mon Dec 11 14:59:31 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Dec 11 14:57:25 2017 +0100| [c16eef67791923bad3a430349c1dbe1e2246c3b3] | committer: Thomas Guillem

direct3d9: gl: don't unlock if a previous lock failed

Didn't see this case happening but nothing prevents it.

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

 modules/video_output/win32/direct3d9.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 7eaf2327f5..ad75f2f9ef 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1812,7 +1812,7 @@ GLConvUpdate(const opengl_tex_converter_t *tc, GLuint *textures,
     HRESULT hr;
 
     picture_sys_t *picsys = ActivePictureSys(pic);
-    if (!picsys)
+    if (unlikely(!picsys || !priv->gl_render))
         return VLC_EGENERIC;
 
     if (!priv->vt.DXUnlockObjectsNV(priv->gl_handle_d3d, 1, &priv->gl_render))
@@ -1838,6 +1838,8 @@ GLConvUpdate(const opengl_tex_converter_t *tc, GLuint *textures,
     if (!priv->vt.DXLockObjectsNV(priv->gl_handle_d3d, 1, &priv->gl_render))
     {
         msg_Warn(tc->gl, "DXLockObjectsNV failed");
+        priv->vt.DXUnregisterObjectNV(priv->gl_handle_d3d, priv->gl_render);
+        priv->gl_render = NULL;
         return VLC_EGENERIC;
     }
 



More information about the vlc-commits mailing list