diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-14 02:11:30 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-14 03:03:41 +0200 |
commit | 640a36a05c4d9d371086c22a158fb3d314a71538 (patch) | |
tree | de200fd28a9d577f92b09a0aeb7faf1ea4c55757 /ffmpeg_filter.c | |
parent | 1ee1a3d9f4e152b641f05d2be6dbe3f440485cca (diff) | |
download | ffmpeg-640a36a05c4d9d371086c22a158fb3d314a71538.tar.gz |
ffmpeg_filter: check that the input media type match the filter
Fixes Ticket2012
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg_filter.c')
-rw-r--r-- | ffmpeg_filter.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c index 4f1e5722cb..80089fff4b 100644 --- a/ffmpeg_filter.c +++ b/ffmpeg_filter.c @@ -626,6 +626,11 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter, char name[255]; int ret, pad_idx = 0; + if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { + av_log(NULL, AV_LOG_ERROR, "Cannot connect video filter to audio input\n"); + return AVERROR(EINVAL); + } + if (!fr.num) fr = av_guess_frame_rate(input_files[ist->file_index]->ctx, ist->st, NULL); @@ -714,6 +719,11 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter, char name[255]; int ret, pad_idx = 0; + if (ist->st->codec->codec_type != AVMEDIA_TYPE_AUDIO) { + av_log(NULL, AV_LOG_ERROR, "Cannot connect audio filter to non audio input\n"); + return AVERROR(EINVAL); + } + av_bprint_init(&args, 0, AV_BPRINT_SIZE_AUTOMATIC); av_bprintf(&args, "time_base=%d/%d:sample_rate=%d:sample_fmt=%s", 1, ist->st->codec->sample_rate, |