diff --git a/modules/codec/aes3.c b/modules/codec/aes3.c index cd6548be54..e2f3bc4df4 100644 --- a/modules/codec/aes3.c +++ b/modules/codec/aes3.c @@ -268,6 +268,9 @@ static int Open( decoder_t *p_dec, bool b_packetizer ) { decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != AUDIO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_302M ) return VLC_EGENERIC; diff --git a/modules/codec/cvdsub.c b/modules/codec/cvdsub.c index dd5df8d1bd..2f1f8714d9 100644 --- a/modules/codec/cvdsub.c +++ b/modules/codec/cvdsub.c @@ -110,6 +110,9 @@ static int DecoderOpen( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != SPU_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_CVD ) return VLC_EGENERIC; diff --git a/modules/codec/daala.c b/modules/codec/daala.c index 83aa3c211f..70035e2136 100644 --- a/modules/codec/daala.c +++ b/modules/codec/daala.c @@ -164,6 +164,9 @@ static int OpenDecoder( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != VIDEO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_DAALA ) { return VLC_EGENERIC; diff --git a/modules/codec/kate.c b/modules/codec/kate.c index fa481bc878..4c7aa6d797 100644 --- a/modules/codec/kate.c +++ b/modules/codec/kate.c @@ -339,6 +339,9 @@ static int OpenDecoder( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != SPU_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_KATE ) { return VLC_EGENERIC; diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c index 46b08e4d1a..5a29c8aaf4 100644 --- a/modules/codec/lpcm.c +++ b/modules/codec/lpcm.c @@ -220,6 +220,9 @@ static int OpenCommon( decoder_t *p_dec, bool b_packetizer ) int i_type; int i_header_size; + if( p_dec->fmt_in.i_cat != AUDIO_ES ) + return VLC_EGENERIC; + switch( p_dec->fmt_in.i_codec ) { /* DVD LPCM */ diff --git a/modules/codec/oggspots.c b/modules/codec/oggspots.c index c5b7d67b1f..5970f24abc 100644 --- a/modules/codec/oggspots.c +++ b/modules/codec/oggspots.c @@ -103,6 +103,9 @@ static int OpenDecoder(vlc_object_t* p_this) decoder_t* p_dec = (decoder_t*)p_this; decoder_sys_t* p_sys; + if (p_dec->fmt_in.i_cat != VIDEO_ES) + return VLC_EGENERIC; + if (p_dec->fmt_in.i_codec != VLC_CODEC_OGGSPOTS) { return VLC_EGENERIC; } diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c index 0c00e33551..e5ca6145a3 100644 --- a/modules/codec/rawvideo.c +++ b/modules/codec/rawvideo.c @@ -78,6 +78,9 @@ vlc_module_end () */ static int OpenCommon( decoder_t *p_dec ) { + if( p_dec->fmt_in.i_cat != VIDEO_ES ) + return VLC_EGENERIC; + const vlc_chroma_description_t *dsc = vlc_fourcc_GetChromaDescription( p_dec->fmt_in.i_codec ); if( dsc == NULL || dsc->plane_count == 0 ) diff --git a/modules/codec/speex.c b/modules/codec/speex.c index 32ac4a8881..d2995ed24c 100644 --- a/modules/codec/speex.c +++ b/modules/codec/speex.c @@ -210,6 +210,9 @@ static int OpenDecoder( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != AUDIO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_SPEEX ) return VLC_EGENERIC; diff --git a/modules/codec/spudec/spudec.c b/modules/codec/spudec/spudec.c index 0f5c9d5869..a68b071bc6 100644 --- a/modules/codec/spudec/spudec.c +++ b/modules/codec/spudec/spudec.c @@ -80,6 +80,9 @@ static int DecoderOpen( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != SPU_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_SPU ) return VLC_EGENERIC; diff --git a/modules/codec/svcdsub.c b/modules/codec/svcdsub.c index b73040735b..72062b068f 100644 --- a/modules/codec/svcdsub.c +++ b/modules/codec/svcdsub.c @@ -116,6 +116,9 @@ static int DecoderOpen( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != SPU_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_OGT ) return VLC_EGENERIC; diff --git a/modules/codec/theora.c b/modules/codec/theora.c index 171f6b317a..91fceff374 100644 --- a/modules/codec/theora.c +++ b/modules/codec/theora.c @@ -151,6 +151,9 @@ static int OpenDecoder( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != VIDEO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_THEORA ) { return VLC_EGENERIC; diff --git a/modules/codec/vorbis.c b/modules/codec/vorbis.c index 6fb61c9d2c..8cb1a2c2e4 100644 --- a/modules/codec/vorbis.c +++ b/modules/codec/vorbis.c @@ -235,6 +235,9 @@ static int OpenDecoder( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != AUDIO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_VORBIS ) return VLC_EGENERIC; diff --git a/modules/packetizer/a52.c b/modules/packetizer/a52.c index e5cf080a2a..5513839ad3 100644 --- a/modules/packetizer/a52.c +++ b/modules/packetizer/a52.c @@ -324,6 +324,9 @@ static int Open( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != AUDIO_ES ) + return VLC_EGENERIC; + switch( p_dec->fmt_in.i_codec ) { case VLC_CODEC_EAC3: diff --git a/modules/packetizer/av1.c b/modules/packetizer/av1.c index fd06fd35bc..5db8f73e1c 100644 --- a/modules/packetizer/av1.c +++ b/modules/packetizer/av1.c @@ -542,6 +542,9 @@ static int Open(vlc_object_t *p_this) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if (p_dec->fmt_in.i_cat != VIDEO_ES) + return VLC_EGENERIC; + if (p_dec->fmt_in.i_codec != VLC_CODEC_AV1) return VLC_EGENERIC; diff --git a/modules/packetizer/avparser.c b/modules/packetizer/avparser.c index 96ba11625d..a7114b593f 100644 --- a/modules/packetizer/avparser.c +++ b/modules/packetizer/avparser.c @@ -86,6 +86,9 @@ int avparser_OpenPacketizer( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != VIDEO_ES ) + return VLC_EGENERIC; + /* Restrict to VP9 for now */ if( p_dec->fmt_in.i_codec != VLC_CODEC_VP9 ) return VLC_EGENERIC; diff --git a/modules/packetizer/dirac.c b/modules/packetizer/dirac.c index 60f62c6193..726b59a2a4 100644 --- a/modules/packetizer/dirac.c +++ b/modules/packetizer/dirac.c @@ -1370,6 +1370,9 @@ static int Open( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != VIDEO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_DIRAC ) return VLC_EGENERIC; diff --git a/modules/packetizer/dts.c b/modules/packetizer/dts.c index 24b0c3b13f..ee9d32e916 100644 --- a/modules/packetizer/dts.c +++ b/modules/packetizer/dts.c @@ -403,6 +403,9 @@ static int Open( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != AUDIO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_DTS ) return VLC_EGENERIC; diff --git a/modules/packetizer/flac.c b/modules/packetizer/flac.c index bfb504f004..b29737d231 100644 --- a/modules/packetizer/flac.c +++ b/modules/packetizer/flac.c @@ -581,6 +581,9 @@ static int Open(vlc_object_t *p_this) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if (p_dec->fmt_in.i_cat != AUDIO_ES) + return VLC_EGENERIC; + if (p_dec->fmt_in.i_codec != VLC_CODEC_FLAC) return VLC_EGENERIC; diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c index 5a4a5196d4..a756199287 100644 --- a/modules/packetizer/h264.c +++ b/modules/packetizer/h264.c @@ -330,6 +330,9 @@ static int Open( vlc_object_t *p_this ) decoder_sys_t *p_sys; int i; + if( p_dec->fmt_in.i_cat != VIDEO_ES ) + return VLC_EGENERIC; + const bool b_avc = (p_dec->fmt_in.i_original_fourcc == VLC_FOURCC( 'a', 'v', 'c', '1' )); if( p_dec->fmt_in.i_codec != VLC_CODEC_H264 ) diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c index e63023b9c9..5be198b56c 100644 --- a/modules/packetizer/hevc.c +++ b/modules/packetizer/hevc.c @@ -174,6 +174,9 @@ static int Open(vlc_object_t *p_this) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if (p_dec->fmt_in.i_cat != VIDEO_ES) + return VLC_EGENERIC; + if (p_dec->fmt_in.i_codec != VLC_CODEC_HEVC) return VLC_EGENERIC; diff --git a/modules/packetizer/mlp.c b/modules/packetizer/mlp.c index 4b5b84e575..5dcbbd4080 100644 --- a/modules/packetizer/mlp.c +++ b/modules/packetizer/mlp.c @@ -473,6 +473,9 @@ static int Open( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != AUDIO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_MLP && p_dec->fmt_in.i_codec != VLC_CODEC_TRUEHD ) return VLC_EGENERIC; diff --git a/modules/packetizer/mpeg4audio.c b/modules/packetizer/mpeg4audio.c index 443800ccdf..2ceb784756 100644 --- a/modules/packetizer/mpeg4audio.c +++ b/modules/packetizer/mpeg4audio.c @@ -204,6 +204,9 @@ static int OpenPacketizer(vlc_object_t *p_this) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if (p_dec->fmt_in.i_cat != AUDIO_ES) + return VLC_EGENERIC; + if (p_dec->fmt_in.i_codec != VLC_CODEC_MP4A) return VLC_EGENERIC; diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c index c5a81e6f3a..fe00638821 100644 --- a/modules/packetizer/mpeg4video.c +++ b/modules/packetizer/mpeg4video.c @@ -136,6 +136,9 @@ static int Open( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != VIDEO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_MP4V ) return VLC_EGENERIC; diff --git a/modules/packetizer/mpegaudio.c b/modules/packetizer/mpegaudio.c index 99b9a0220e..fe6dfb0797 100644 --- a/modules/packetizer/mpegaudio.c +++ b/modules/packetizer/mpegaudio.c @@ -615,6 +615,9 @@ static int Open( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != AUDIO_ES ) + return VLC_EGENERIC; + if(( p_dec->fmt_in.i_codec != VLC_CODEC_MPGA ) && ( p_dec->fmt_in.i_codec != VLC_CODEC_MP3 ) ) { diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c index 00b292a836..a429ebb747 100644 --- a/modules/packetizer/mpegvideo.c +++ b/modules/packetizer/mpegvideo.c @@ -196,6 +196,9 @@ static int Open( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != VIDEO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV ) return VLC_EGENERIC; diff --git a/modules/packetizer/vc1.c b/modules/packetizer/vc1.c index 8f70154d8a..304f1c2e5d 100644 --- a/modules/packetizer/vc1.c +++ b/modules/packetizer/vc1.c @@ -143,6 +143,9 @@ static int Open( vlc_object_t *p_this ) decoder_t *p_dec = (decoder_t*)p_this; decoder_sys_t *p_sys; + if( p_dec->fmt_in.i_cat != VIDEO_ES ) + return VLC_EGENERIC; + if( p_dec->fmt_in.i_codec != VLC_CODEC_VC1 ) return VLC_EGENERIC;