[vlc-devel] [PATCH 28/34] vdpau: check the input video context of filters matches the VDPAU chromas
Steve Lhomme
robux4 at ycbcr.xyz
Fri Nov 8 15:40:32 CET 2019
---
modules/hw/vdpau/adjust.c | 3 +++
modules/hw/vdpau/deinterlace.c | 3 +++
modules/hw/vdpau/sharpen.c | 3 +++
3 files changed, 9 insertions(+)
diff --git a/modules/hw/vdpau/adjust.c b/modules/hw/vdpau/adjust.c
index d522279c49d..26607eee567 100644
--- a/modules/hw/vdpau/adjust.c
+++ b/modules/hw/vdpau/adjust.c
@@ -129,6 +129,9 @@ static int Open(vlc_object_t *obj)
{
filter_t *filter = (filter_t *)obj;
+ if ( filter->vctx_in == NULL ||
+ vlc_video_context_GetType(filter->vctx_in) != VLC_VIDEO_CONTEXT_VDPAU )
+ return VLC_EGENERIC;
if (filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_420
&& filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_422
&& filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_444)
diff --git a/modules/hw/vdpau/deinterlace.c b/modules/hw/vdpau/deinterlace.c
index c57dcd509da..2eaf90974e6 100644
--- a/modules/hw/vdpau/deinterlace.c
+++ b/modules/hw/vdpau/deinterlace.c
@@ -100,6 +100,9 @@ static int Open(vlc_object_t *obj)
{
filter_t *filter = (filter_t *)obj;
+ if ( filter->vctx_in == NULL ||
+ vlc_video_context_GetType(filter->vctx_in) != VLC_VIDEO_CONTEXT_VDPAU )
+ return VLC_EGENERIC;
if (filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_420
&& filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_422
&& filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_444)
diff --git a/modules/hw/vdpau/sharpen.c b/modules/hw/vdpau/sharpen.c
index 72ccbcedf0c..4d191188a13 100644
--- a/modules/hw/vdpau/sharpen.c
+++ b/modules/hw/vdpau/sharpen.c
@@ -83,6 +83,9 @@ static int Open(vlc_object_t *obj)
{
filter_t *filter = (filter_t *)obj;
+ if ( filter->vctx_in == NULL ||
+ vlc_video_context_GetType(filter->vctx_in) != VLC_VIDEO_CONTEXT_VDPAU )
+ return VLC_EGENERIC;
if (filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_420
&& filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_422
&& filter->fmt_in.video.i_chroma != VLC_CODEC_VDPAU_VIDEO_444)
--
2.17.1
More information about the vlc-devel
mailing list