]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/af_amerge.c
Merge commit '3ad825793a43253154bed05827f27425fc0757df'
[ffmpeg] / libavfilter / af_amerge.c
index 3cf36b30380866b998ace5deea337cc80fd20a99..09c660ef49b5566aa24088e6684fb8f8b6aabdeb 100644 (file)
@@ -37,7 +37,7 @@
 
 #define SWR_CH_MAX 64
 
-typedef struct {
+typedef struct AMergeContext {
     const AVClass *class;
     int nb_inputs;
     int route[SWR_CH_MAX]; /**< channels routing, see copy_samples */
@@ -322,7 +322,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
 static av_cold int init(AVFilterContext *ctx)
 {
     AMergeContext *s = ctx->priv;
-    int i;
+    int i, ret;
 
     s->in = av_calloc(s->nb_inputs, sizeof(*s->in));
     if (!s->in)
@@ -336,7 +336,10 @@ static av_cold int init(AVFilterContext *ctx)
         };
         if (!name)
             return AVERROR(ENOMEM);
-        ff_insert_inpad(ctx, i, &pad);
+        if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) {
+            av_freep(&pad.name);
+            return ret;
+        }
     }
     return 0;
 }