[vlc-commits] d3d11_surface: don't use an invalid context in release builds

Steve Lhomme git at videolan.org
Tue Feb 13 15:57:48 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Feb 13 15:50:53 2018 +0100| [2c07a5d9d1ec63e20c88450c0cb844e04ca88fe4] | committer: Steve Lhomme

d3d11_surface: don't use an invalid context in release builds

Should help fixing 7c98a952-ee98-42ef-82a3-8bc4049f3562

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

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

diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index 359cc7e5a4..9463a18b64 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -262,8 +262,14 @@ ok:
 
 static void D3D11_YUY2(filter_t *p_filter, picture_t *src, picture_t *dst)
 {
+    if (src->context == NULL)
+    {
+        /* the previous stages creating a D3D11 picture should always fill the context */
+        msg_Err(p_filter, "missing source context");
+        return;
+    }
+
     filter_sys_t *sys = (filter_sys_t*) p_filter->p_sys;
-    assert(src->context != NULL);
     picture_sys_t *p_sys = &((struct va_pic_context*)src->context)->picsys;
 
     D3D11_TEXTURE2D_DESC desc;
@@ -397,8 +403,14 @@ static void D3D11_YUY2(filter_t *p_filter, picture_t *src, picture_t *dst)
 
 static void D3D11_NV12(filter_t *p_filter, picture_t *src, picture_t *dst)
 {
+    if (src->context == NULL)
+    {
+        /* the previous stages creating a D3D11 picture should always fill the context */
+        msg_Err(p_filter, "missing source context");
+        return;
+    }
+
     filter_sys_t *sys = (filter_sys_t*) p_filter->p_sys;
-    assert(src->context != NULL);
     picture_sys_t *p_sys = &((struct va_pic_context*)src->context)->picsys;
 
     D3D11_TEXTURE2D_DESC desc;



More information about the vlc-commits mailing list