[vlc-commits] d3d11: fix use of potentially uninitialized d3d11_device

Steve Lhomme git at videolan.org
Mon Aug 17 16:14:40 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Aug 17 16:10:02 2020 +0200| [d01f93b838ecda77c58ccb00c8c82562b6771429] | committer: Steve Lhomme

d3d11: fix use of potentially uninitialized d3d11_device

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

 modules/hw/d3d11/d3d11_deinterlace.c | 5 +++--
 modules/hw/d3d11/d3d11_surface.c     | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index 8478d2a189..b2c8d99447 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -251,10 +251,11 @@ int D3D11OpenDeinterlace(vlc_object_t *obj)
         return VLC_ENOMEM;
     memset(sys, 0, sizeof (*sys));
 
-    d3d11_device_lock(sys->d3d_dev);
-
     d3d11_decoder_device_t *dev_sys = GetD3D11OpaqueContext( filter->vctx_in );
     sys->d3d_dev = &dev_sys->d3d_dev;
+
+    d3d11_device_lock(sys->d3d_dev);
+
     if (D3D11_CreateProcessor(filter, sys->d3d_dev, D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST,
                               &filter->fmt_out.video, &filter->fmt_out.video, &sys->d3d_proc) != VLC_SUCCESS)
         goto error;
diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index c5623f38e1..d6bc9ba026 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -83,7 +83,7 @@ static int SetupProcessor(filter_t *p_filter, d3d11_device_t *d3d_dev,
     filter_sys_t *sys = p_filter->p_sys;
     HRESULT hr;
 
-    d3d11_device_lock(sys->d3d_dev);
+    d3d11_device_lock(d3d_dev);
 
     if (D3D11_CreateProcessor(p_filter, d3d_dev, D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE,
                               &p_filter->fmt_in.video, &p_filter->fmt_out.video, &sys->d3d_proc) != VLC_SUCCESS)
@@ -125,7 +125,7 @@ static int SetupProcessor(filter_t *p_filter, d3d11_device_t *d3d_dev,
                 msg_Err(p_filter, "Failed to create the processor output. (hr=0x%lX)", hr);
             else
             {
-                d3d11_device_unlock(sys->d3d_dev);
+                d3d11_device_unlock(d3d_dev);
                 return VLC_SUCCESS;
             }
         }
@@ -138,7 +138,7 @@ static int SetupProcessor(filter_t *p_filter, d3d11_device_t *d3d_dev,
 
 error:
     D3D11_ReleaseProcessor(&sys->d3d_proc);
-    d3d11_device_unlock(sys->d3d_dev);
+    d3d11_device_unlock(d3d_dev);
     return VLC_EGENERIC;
 }
 #endif



More information about the vlc-commits mailing list