[SCM] libav/experimental: Check linked pads media type mismatch in avfilter_link().

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:21:49 UTC 2013


The following commit has been merged in the experimental branch:
commit 891aeeee72b2d57d380ca097cc34be2b0c360233
Author: Stefano Sabatini <stefano.sabatini-lala at poste.it>
Date:   Thu Jan 13 01:00:36 2011 +0000

    Check linked pads media type mismatch in avfilter_link().
    
    Originally committed as revision 26325 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index ebb2165..6ecd4ce 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));
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list