Browse Source

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>
tags/n2.1
Martin Storsjö 11 years ago
parent
commit
d433e1aefa
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavutil/mem.c

+ 1
- 1
libavutil/mem.c View File

@@ -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);
}


Loading…
Cancel
Save