Skip to content

Commit

Permalink
lavfi/concat: prefer av_asprintf() over stack allocated buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
ubitux committed Nov 29, 2012
1 parent b99f130 commit a7eabbb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions libavfilter/avf_concat.c
Expand Up @@ -24,6 +24,7 @@
*/

#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "avfilter.h"
Expand Down Expand Up @@ -344,7 +345,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
ConcatContext *cat = ctx->priv;
int ret;
unsigned seg, type, str;
char name[32];

cat->class = &concat_class;
av_opt_set_defaults(cat);
Expand All @@ -365,8 +365,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
.get_audio_buffer = get_audio_buffer,
.filter_frame = filter_frame,
};
snprintf(name, sizeof(name), "in%d:%c%d", seg, "va"[type], str);
pad.name = av_strdup(name);
pad.name = av_asprintf("in%d:%c%d", seg, "va"[type], str);
ff_insert_inpad(ctx, ctx->nb_inputs, &pad);
}
}
Expand All @@ -379,8 +378,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
.config_props = config_output,
.request_frame = request_frame,
};
snprintf(name, sizeof(name), "out:%c%d", "va"[type], str);
pad.name = av_strdup(name);
pad.name = av_asprintf("out:%c%d", "va"[type], str);
ff_insert_outpad(ctx, ctx->nb_outputs, &pad);
}
}
Expand Down

0 comments on commit a7eabbb

Please sign in to comment.