1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Check linked pads media type mismatch in avfilter_link().

Originally committed as revision 26325 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Stefano Sabatini 2011-01-13 01:00:36 +00:00
parent 8b69c2f463
commit 891aeeee72

View File

@ -107,6 +107,13 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
src->outputs[srcpad] || dst->inputs[dstpad]) src->outputs[srcpad] || dst->inputs[dstpad])
return -1; 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] = src->outputs[srcpad] =
dst-> inputs[dstpad] = link = av_mallocz(sizeof(AVFilterLink)); dst-> inputs[dstpad] = link = av_mallocz(sizeof(AVFilterLink));