[vlc-commits] d3d11: check CopyInitCache return value
Thomas Guillem
git at videolan.org
Fri Mar 16 16:08:32 CET 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Mar 14 16:03:30 2018 +0100| [97f701923a7ac20ab429d6c7d206954f47c03ced] | committer: Thomas Guillem
d3d11: check CopyInitCache return value
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=97f701923a7ac20ab429d6c7d206954f47c03ced
---
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 4ffcce533c..35997ef4b9 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -746,15 +746,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