Add missing check on the existence of an associated output pad for
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Thu, 11 Nov 2010 22:41:22 +0000 (22:41 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Thu, 11 Nov 2010 22:41:22 +0000 (22:41 +0000)
each specified output link label.

Fix crash.

Originally committed as revision 25723 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavfilter/graphparser.c

index 4266e81..99982b3 100644 (file)
@@ -294,6 +294,12 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
         AVFilterInOut *match;
 
         AVFilterInOut *input = *curr_inputs;
+        if (!input) {
+            av_log(log_ctx, AV_LOG_ERROR,
+                   "No output pad can be associated to link label '%s'.\n",
+                   name);
+            return AVERROR(EINVAL);
+        }
         *curr_inputs = (*curr_inputs)->next;
 
         if (!name)