]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/graphparser.c
avcodec/adpcm_ima_apm: remove old extradata format
[ffmpeg] / libavfilter / graphparser.c
index e96b20418e786e9dbade459598f5a7e5be69bc06..1385c3ae71aa5f5b2f8dc830bf71eaf4ec06404a 100644 (file)
@@ -186,9 +186,16 @@ static int parse_filter(AVFilterContext **filt_ctx, const char **buf, AVFilterGr
     char *name = av_get_token(buf, "=,;[");
     int ret;
 
+    if (!name)
+        return AVERROR(ENOMEM);
+
     if (**buf == '=') {
         (*buf)++;
         opts = av_get_token(buf, "[],;");
+        if (!opts) {
+            av_free(name);
+            return AVERROR(ENOMEM);
+        }
     }
 
     ret = create_filter(filt_ctx, graph, index, name, opts, log_ctx);
@@ -365,15 +372,14 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
         match = extract_inout(name, open_inputs);
 
         if (match) {
-            if ((ret = link_filter(input->filter_ctx, input->pad_idx,
-                                   match->filter_ctx, match->pad_idx, log_ctx)) < 0) {
-                av_free(name);
-                return ret;
-            }
+            ret = link_filter(input->filter_ctx, input->pad_idx,
+                              match->filter_ctx, match->pad_idx, log_ctx);
             av_freep(&match->name);
             av_freep(&name);
             av_freep(&match);
             av_freep(&input);
+            if (ret < 0)
+                return ret;
         } else {
             /* Not in the list, so add the first input as an open_output */
             input->name = name;