[vlc-devel] [PATCH 5/6] hw:d3d11:d3d11_deinterlace: check values are ok

Steve Lhomme robux4 at videolabs.io
Fri Nov 24 16:24:47 CET 2017


Also release unsused memory.

CID #1462212, #1462211
---
 modules/hw/d3d11/d3d11_deinterlace.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index 2068ac63c1..841e413556 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -128,6 +128,8 @@ static int RenderPic( filter_t *p_filter, picture_t *p_outpic, picture_t *p_pic,
     HRESULT hr;
     filter_sys_t *p_sys = p_filter->p_sys;
 
+    //msg_Dbg(p_filter, "%lx  deinterlace", GetCurrentThreadId());
+
     picture_t *p_prev = p_sys->context.pp_history[0];
     picture_t *p_cur  = p_sys->context.pp_history[1];
     picture_t *p_next = p_sys->context.pp_history[2];
@@ -297,6 +299,11 @@ static picture_t *NewOutputPicture( filter_t *p_filter )
                     break;
                 }
             }
+            if (unlikely(cfg == NULL))
+            {
+                free(pic->p_sys);
+                return NULL;
+            }
 
             /* create the texture that's missing */
             video_format_t fmt = p_filter->fmt_out.video;
@@ -553,6 +560,7 @@ error:
         ID3D11VideoDevice_Release(sys->d3dviddev);
     if (sys->d3d_dev.d3dcontext)
         D3D11_FilterReleaseInstance(&sys->d3d_dev);
+    free(sys);
 
     return VLC_EGENERIC;
 }
-- 
2.14.2



More information about the vlc-devel mailing list