From d433e1aefabd7934d9ba9ae552525faacf4e47c5 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Sat, 5 Oct 2013 00:19:13 +0300 Subject: mem: Make av_strdup allocate using av_realloc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes sure that pointers from av_strdup are reallocable, which is used in av_dict_set if the AV_DICT_APPEND flag is set. Nothing should rely on pointers from av_strdup being aligned. Signed-off-by: Martin Storsjö --- libavutil/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavutil/mem.c') diff --git a/libavutil/mem.c b/libavutil/mem.c index b84020c0f9..15a8c07381 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -214,7 +214,7 @@ char *av_strdup(const char *s) char *ptr = NULL; if (s) { int len = strlen(s) + 1; - ptr = av_malloc(len); + ptr = av_realloc(NULL, len); if (ptr) memcpy(ptr, s, len); } -- cgit v1.2.3