]> git.sesse.net Git - ffmpeg/commitdiff
Check linked pads media type mismatch in avfilter_link().
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Thu, 13 Jan 2011 01:00:36 +0000 (01:00 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Thu, 13 Jan 2011 01:00:36 +0000 (01:00 +0000)
Originally committed as revision 26325 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavfilter/avfilter.c

index ebb216518459a83cbc851625226516ef80554f24..6ecd4ce4c2065804495ae6a75078774c5ddfba99 100644 (file)
@@ -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));