Module: libav
Branch: master
Commit: d433e1aefabd7934d9ba9ae552525faacf4e47c5

Author:    Martin Storsjö <[email protected]>
Committer: Martin Storsjö <[email protected]>
Date:      Sat Oct  5 00:19:13 2013 +0300

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ö <[email protected]>

---

 libavutil/mem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/mem.c b/libavutil/mem.c
index b84020c..15a8c07 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);
     }

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to