[FFmpeg-cvslog] avfilter: check filter link validity

Vittorio Giovara git at videolan.org
Sun Jan 18 01:18:24 CET 2015


ffmpeg | branch: release/2.4 | Vittorio Giovara <vittorio.giovara at gmail.com> | Mon Oct 20 14:11:13 2014 +0100| [a7e79f6a43bdc7e3b164dd78b060f0d5575a0cf0] | committer: Vittorio Giovara

avfilter: check filter link validity

Remove now redundant check.

CC: libav-stable at libav.org
Bug-Id: CID 700371

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7e79f6a43bdc7e3b164dd78b060f0d5575a0cf0
---

 libavfilter/avfilter.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index c9617dc..4098973 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -152,6 +152,11 @@ int avfilter_config_links(AVFilterContext *filter)
         AVFilterLink *link = filter->inputs[i];
 
         if (!link) continue;
+        if (!link->src || !link->dst) {
+            av_log(filter, AV_LOG_ERROR,
+                   "Not all input and output are properly linked (%d).\n", i);
+            return AVERROR(EINVAL);
+        }
 
         switch (link->init_state) {
         case AVLINK_INIT:
@@ -181,7 +186,7 @@ int avfilter_config_links(AVFilterContext *filter)
             }
 
             if (link->time_base.num == 0 && link->time_base.den == 0)
-                link->time_base = link->src && link->src->nb_inputs ?
+                link->time_base = link->src->nb_inputs ?
                     link->src->inputs[0]->time_base : AV_TIME_BASE_Q;
 
             if (link->type == AVMEDIA_TYPE_VIDEO) {



More information about the ffmpeg-cvslog mailing list