]> git.sesse.net Git - ffmpeg/commitdiff
graphparser: set next to NULL on an entry extracted from inputs list
authorAnton Khirnov <anton@khirnov.net>
Sun, 15 Apr 2012 19:08:37 +0000 (21:08 +0200)
committerAnton Khirnov <anton@khirnov.net>
Mon, 16 Apr 2012 07:28:34 +0000 (09:28 +0200)
Prevents it from referring to the rest of the list.

libavfilter/graphparser.c

index f3189843971a09d0f3c88b2657c914ae1cb6b471..b3f295f933067c0544118a2725f4fe820041dece 100644 (file)
@@ -229,9 +229,10 @@ static int link_filter_inouts(AVFilterContext *filt_ctx,
     for (pad = 0; pad < filt_ctx->input_count; pad++) {
         AVFilterInOut *p = *curr_inputs;
 
-        if (p)
+        if (p) {
             *curr_inputs = (*curr_inputs)->next;
-        else if (!(p = av_mallocz(sizeof(*p))))
+            p->next = NULL;
+        } else if (!(p = av_mallocz(sizeof(*p))))
             return AVERROR(ENOMEM);
 
         if (p->filter_ctx) {