[vlc-commits] d3d11: check CopyInitCache return value

Thomas Guillem git at videolan.org
Mon Mar 19 12:15:38 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Mar 14 16:03:30 2018 +0100| [6ced285b1aa45006bddcf006481eb65a3fef6cdb] | committer: Thomas Guillem

d3d11: check CopyInitCache return value

(cherry picked from commit 97f701923a7ac20ab429d6c7d206954f47c03ced)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/hw/d3d11/d3d11_surface.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index 7f360f3135..44235b78ed 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -695,15 +695,18 @@ int D3D11OpenConverter( vlc_object_t *obj )
 
     filter_sys_t *p_sys = vlc_obj_calloc(obj, 1, sizeof(filter_sys_t));
     if (!p_sys)
-         return VLC_EGENERIC;
+        return VLC_ENOMEM;
+
+    if (CopyInitCache(&p_sys->cache, p_filter->fmt_in.video.i_width * pixel_bytes))
+        return VLC_ENOMEM;
 
     if (D3D11_Create(p_filter, &p_sys->hd3d) != VLC_SUCCESS)
     {
         msg_Warn(p_filter, "cannot load d3d11.dll, aborting");
+        CopyCleanCache(&p_sys->cache);
         return VLC_EGENERIC;
     }
 
-    CopyInitCache(&p_sys->cache, p_filter->fmt_in.video.i_width * pixel_bytes);
     vlc_mutex_init(&p_sys->staging_lock);
     p_filter->p_sys = p_sys;
     return VLC_SUCCESS;



More information about the vlc-commits mailing list