aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-01-13 01:00:36 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-01-13 01:00:36 +0000
commit891aeeee72b2d57d380ca097cc34be2b0c360233 (patch)
tree966dae8ea7a82dda68da6ed014fb24b1825eb40d
parent8b69c2f4638da056591ac3dfee238b83f1eb74b2 (diff)
downloadffmpeg-891aeeee72b2d57d380ca097cc34be2b0c360233.tar.gz
Check linked pads media type mismatch in avfilter_link().
Originally committed as revision 26325 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavfilter/avfilter.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index ebb2165184..6ecd4ce4c2 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -107,6 +107,13 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
src->outputs[srcpad] || dst->inputs[dstpad])
return -1;
+ if (src->output_pads[srcpad].type != dst->input_pads[dstpad].type) {
+ av_log(src, AV_LOG_ERROR,
+ "Media type mismatch between the '%s' filter output pad %d and the '%s' filter input pad %d\n",
+ src->name, srcpad, dst->name, dstpad);
+ return AVERROR(EINVAL);
+ }
+
src->outputs[srcpad] =
dst-> inputs[dstpad] = link = av_mallocz(sizeof(AVFilterLink));