[vlc-commits] d3d9: check CopyInitCache return value

Thomas Guillem git at videolan.org
Fri Mar 16 16:08:33 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Mar 14 16:02:45 2018 +0100| [6275ef832a49d0dcb109b68ebd77160dc7c1e08a] | committer: Thomas Guillem

d3d9: check CopyInitCache return value

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

 modules/hw/d3d9/dxa9.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c
index ede3e9b644..93970c970c 100644
--- a/modules/hw/d3d9/dxa9.c
+++ b/modules/hw/d3d9/dxa9.c
@@ -314,13 +314,19 @@ int D3D9OpenConverter( vlc_object_t *obj )
     if (!p_sys)
          return VLC_ENOMEM;
 
+    if (CopyInitCache(&p_sys->cache, p_filter->fmt_in.video.i_width ))
+    {
+        free(p_sys);
+        return VLC_ENOMEM;
+    }
+
     if (unlikely(D3D9_Create( p_filter, &p_sys->hd3d ) != VLC_SUCCESS)) {
         msg_Warn(p_filter, "cannot load d3d9.dll, aborting");
+        CopyCleanCache(&p_sys->cache);
         free(p_sys);
         return VLC_EGENERIC;
     }
 
-    CopyInitCache(&p_sys->cache, p_filter->fmt_in.video.i_width );
     p_filter->p_sys = p_sys;
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list