[vlc-commits] d3d11_surface: initialize the GPU-mapped picture with no extra allocation

Steve Lhomme git at videolan.org
Wed Jul 22 15:57:38 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul 22 15:50:14 2020 +0200| [c3844df362ee43d29ec88d1241326f33c2e289ef] | committer: Steve Lhomme

d3d11_surface: initialize the GPU-mapped picture with no extra allocation

We want the planes to be setup but not to allocate them because we will
overwrite them anyway.

They did not leak but were allocated for nothing.

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

 modules/hw/d3d11/d3d11_surface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index bc30a8f1f9..4622436c4e 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -614,7 +614,8 @@ static picture_t *AllocateCPUtoGPUTexture(filter_t *p_filter, filter_sys_t *p_sy
     video_format_Copy(&fmt_staging, &p_filter->fmt_out.video);
     fmt_staging.i_chroma = cfg->fourcc;
 
-    picture_t *p_dst = picture_NewFromFormat(&fmt_staging);
+    picture_resource_t dummy_res = {};
+    picture_t *p_dst = picture_NewFromResource(&fmt_staging, &dummy_res);
     if (p_dst == NULL) {
         msg_Err(p_filter, "Failed to map create the temporary picture.");
         goto done;



More information about the vlc-commits mailing list