mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 08:42:39 +00:00
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>
This commit is contained in:
parent
825c7c62bb
commit
d433e1aefa
@ -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…
Reference in New Issue
Block a user