diff options
author | Martin Storsjö <martin@martin.st> | 2013-10-05 00:19:13 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-10-16 18:59:01 +0300 |
commit | d433e1aefabd7934d9ba9ae552525faacf4e47c5 (patch) | |
tree | 448e47b432912a24ba68465f2ef5cc6ace4b1e7a | |
parent | 825c7c62bb66c9ee6117e0dcb71915271faa46c6 (diff) | |
download | ffmpeg-d433e1aefabd7934d9ba9ae552525faacf4e47c5.tar.gz |
mem: Make av_strdup allocate using av_realloc
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ö <martin@martin.st>
-rw-r--r-- | libavutil/mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |