[vlc-commits] d3d9: check the input video context of filters matches the D3D9 chromas

Steve Lhomme git at videolan.org
Mon Dec 2 15:23:11 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Nov  8 09:05:08 2019 +0100| [c791f6653273629adce513178c9376ead7ba3a78] | committer: Steve Lhomme

d3d9: check the input video context of filters matches the D3D9 chromas

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

 modules/hw/d3d9/d3d9_filters.c      | 2 ++
 modules/hw/d3d9/dxa9.c              | 2 ++
 modules/hw/d3d9/dxva2_deinterlace.c | 7 ++-----
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/hw/d3d9/d3d9_filters.c b/modules/hw/d3d9/d3d9_filters.c
index 5261eec035..1769af8c6e 100644
--- a/modules/hw/d3d9/d3d9_filters.c
+++ b/modules/hw/d3d9/d3d9_filters.c
@@ -235,6 +235,8 @@ static int D3D9OpenAdjust(vlc_object_t *obj)
     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;
+    if ( GetD3D9ContextPrivate(filter->vctx_in) == NULL )
+        return VLC_EGENERIC;
     if (!video_format_IsSimilar(&filter->fmt_in.video, &filter->fmt_out.video))
         return VLC_EGENERIC;
 
diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c
index 64021a9036..45f4449308 100644
--- a/modules/hw/d3d9/dxa9.c
+++ b/modules/hw/d3d9/dxa9.c
@@ -292,6 +292,8 @@ int D3D9OpenConverter( vlc_object_t *obj )
     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;
+    if ( GetD3D9ContextPrivate(p_filter->vctx_in) == NULL )
+        return VLC_EGENERIC;
 
     if ( p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height
          || p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width )
diff --git a/modules/hw/d3d9/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c
index 4bee6dad12..7bc28700aa 100644
--- a/modules/hw/d3d9/dxva2_deinterlace.c
+++ b/modules/hw/d3d9/dxva2_deinterlace.c
@@ -352,6 +352,8 @@ int D3D9OpenDeinterlace(vlc_object_t *obj)
     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;
+    if ( GetD3D9ContextPrivate(filter->vctx_in) == NULL )
+        return VLC_EGENERIC;
     if (!video_format_IsSimilar(&filter->fmt_in.video, &filter->fmt_out.video))
         return VLC_EGENERIC;
 
@@ -364,11 +366,6 @@ int D3D9OpenDeinterlace(vlc_object_t *obj)
         goto error;
 
     d3d9_video_context_t *vtcx_sys = GetD3D9ContextPrivate( filter->vctx_in );
-    if (!vtcx_sys)
-    {
-        msg_Dbg(filter, "Filter without a context");
-        goto error;
-    }
 
     d3d9_decoder_device_t *d3d9_decoder = GetD3D9OpaqueContext( filter->vctx_in );
 



More information about the vlc-commits mailing list