[vlc-commits] d3d11_surface: don't use an invalid context in release builds
Steve Lhomme
git at videolan.org
Wed Feb 14 16:48:08 CET 2018
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Feb 13 15:50:53 2018 +0100| [0005d5e14198547e438849c2b8817878b169fb25] | committer: Hugo Beauzée-Luyssen
d3d11_surface: don't use an invalid context in release builds
Should help fixing 7c98a952-ee98-42ef-82a3-8bc4049f3562
(cherry picked from commit 2c07a5d9d1ec63e20c88450c0cb844e04ca88fe4)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=0005d5e14198547e438849c2b8817878b169fb25
---
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 f57ed230da..2298097c47 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;
@@ -403,8 +409,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