[vlc-devel] [PATCH 27/34] d3d9: check the input video context of filters matches the D3D9 chromas
Steve Lhomme
robux4 at ycbcr.xyz
Fri Nov 8 15:40:31 CET 2019
---
modules/hw/d3d9/d3d9_filters.c | 3 +++
modules/hw/d3d9/dxa9.c | 3 +++
modules/hw/d3d9/dxva2_deinterlace.c | 3 +++
3 files changed, 9 insertions(+)
diff --git a/modules/hw/d3d9/d3d9_filters.c b/modules/hw/d3d9/d3d9_filters.c
index 5261eec0353..d3ef50965da 100644
--- a/modules/hw/d3d9/d3d9_filters.c
+++ b/modules/hw/d3d9/d3d9_filters.c
@@ -232,6 +232,9 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
GUID *processorGUID = NULL;
IDirectXVideoProcessorService *processor = NULL;
+ if ( filter->vctx_in == NULL ||
+ vlc_video_context_GetType(filter->vctx_in) != VLC_VIDEO_CONTEXT_DXVA2 )
+ return VLC_EGENERIC;
if (filter->fmt_in.video.i_chroma != VLC_CODEC_D3D9_OPAQUE
&& filter->fmt_in.video.i_chroma != VLC_CODEC_D3D9_OPAQUE_10B)
return VLC_EGENERIC;
diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c
index 393d85262aa..712293e4c4e 100644
--- a/modules/hw/d3d9/dxa9.c
+++ b/modules/hw/d3d9/dxa9.c
@@ -281,6 +281,9 @@ int D3D9OpenConverter( vlc_object_t *obj )
{
filter_t *p_filter = (filter_t *)obj;
+ if ( p_filter->vctx_in == NULL ||
+ vlc_video_context_GetType(p_filter->vctx_in) != VLC_VIDEO_CONTEXT_DXVA2 )
+ return VLC_EGENERIC;
if ( p_filter->fmt_in.video.i_chroma != VLC_CODEC_D3D9_OPAQUE &&
p_filter->fmt_in.video.i_chroma != VLC_CODEC_D3D9_OPAQUE_10B )
return VLC_EGENERIC;
diff --git a/modules/hw/d3d9/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c
index 2564752818e..cbd9b38d8bd 100644
--- a/modules/hw/d3d9/dxva2_deinterlace.c
+++ b/modules/hw/d3d9/dxva2_deinterlace.c
@@ -347,6 +347,9 @@ int D3D9OpenDeinterlace(vlc_object_t *obj)
GUID *processorGUID = NULL;
IDirectXVideoProcessorService *processor = NULL;
+ if ( filter->vctx_in == NULL ||
+ vlc_video_context_GetType(filter->vctx_in) != VLC_VIDEO_CONTEXT_DXVA2 )
+ return VLC_EGENERIC;
if (filter->fmt_in.video.i_chroma != VLC_CODEC_D3D9_OPAQUE
&& filter->fmt_in.video.i_chroma != VLC_CODEC_D3D9_OPAQUE_10B)
return VLC_EGENERIC;
--
2.17.1
More information about the vlc-devel
mailing list