[vlc-devel] [PATCH 26/34] d3d11: check the input video context of filters matches the D3D11 chromas

Steve Lhomme robux4 at ycbcr.xyz
Fri Nov 8 15:40:30 CET 2019


---
 modules/hw/d3d11/d3d11_deinterlace.c | 3 +++
 modules/hw/d3d11/d3d11_filters.c     | 3 +++
 modules/hw/d3d11/d3d11_surface.c     | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index 90215efbd70..37bd0a962fb 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -286,6 +286,9 @@ int D3D11OpenDeinterlace(vlc_object_t *obj)
     filter_t *filter = (filter_t *)obj;
     HRESULT hr;
 
+    if ( filter->vctx_in == NULL ||
+         vlc_video_context_GetType(filter->vctx_in) != VLC_VIDEO_CONTEXT_D3D11VA )
+        return VLC_EGENERIC;
     if (!is_d3d11_opaque(filter->fmt_in.video.i_chroma))
         return VLC_EGENERIC;
     if (!video_format_IsSimilar(&filter->fmt_in.video, &filter->fmt_out.video))
diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c
index 7857628639e..4c8ec8117be 100644
--- a/modules/hw/d3d11/d3d11_filters.c
+++ b/modules/hw/d3d11/d3d11_filters.c
@@ -319,6 +319,9 @@ static int D3D11OpenAdjust(vlc_object_t *obj)
     filter_t *filter = (filter_t *)obj;
     HRESULT hr;
 
+    if ( filter->vctx_in == NULL ||
+         vlc_video_context_GetType(filter->vctx_in) != VLC_VIDEO_CONTEXT_D3D11VA )
+        return VLC_EGENERIC;
     if (!is_d3d11_opaque(filter->fmt_in.video.i_chroma))
         return VLC_EGENERIC;
     if (!video_format_IsSimilar(&filter->fmt_in.video, &filter->fmt_out.video))
diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index 68fdc88c2b3..62a191fb7e4 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -595,6 +595,9 @@ int D3D11OpenConverter( 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_D3D11VA )
+        return VLC_EGENERIC;
     if ( !is_d3d11_opaque(p_filter->fmt_in.video.i_chroma) )
         return VLC_EGENERIC;
 
-- 
2.17.1



More information about the vlc-devel mailing list