aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-01-13 01:53:34 +0100
committerClément Bœsch <ubitux@gmail.com>2012-01-13 16:22:20 +0100
commite3127db43877c7587975f58922b6087cea4ed706 (patch)
tree3068718e1013128c2047291589074094420532bf /ffmpeg.c
parent2a81e0c2ad887b85991e71d35a75928677677c51 (diff)
downloadffmpeg-e3127db43877c7587975f58922b6087cea4ed706.tar.gz
ffmpeg: use av_asprintf() in opt_old2new() and fix a memleak.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 125a143993..47c56cb9cb 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -4866,9 +4866,9 @@ static int opt_passlogfile(const char *opt, const char *arg)
static int opt_old2new(OptionsContext *o, const char *opt, const char *arg)
{
- char *s= av_malloc(strlen(opt)+2);
- snprintf(s, strlen(opt)+2, "%s:%c", opt+1, *opt);
- return parse_option(o, s, arg, options);
+ char *s = av_asprintf("%s:%c", opt + 1, *opt);
+ parse_option(o, s, arg, options);
+ av_free(s);
}
static int opt_bitrate(OptionsContext *o, const char *opt, const char *arg)