mirror of https://git.ffmpeg.org/ffmpeg.git
avutil/dict: do not realloc entries when deleting a non-existing item
Deleting a non-existing item should not invalidate existing entries returned with av_dict_get. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
652173f63f
commit
a740263d7e
|
@ -98,7 +98,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
|
|||
av_free(tag->value);
|
||||
av_free(tag->key);
|
||||
*tag = m->elems[--m->count];
|
||||
} else {
|
||||
} else if (copy_value) {
|
||||
AVDictionaryEntry *tmp = av_realloc(m->elems,
|
||||
(m->count + 1) * sizeof(*m->elems));
|
||||
if (!tmp)
|
||||
|
|
Loading…
Reference in New Issue