summaryrefslogtreecommitdiff
path: root/libavutil/dict.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2016-02-06 17:23:02 +0100
committerMarton Balint <cus@passwd.hu>2016-03-15 00:55:16 +0100
commita740263d7e7be5bb909ae83a44b21cc8cf8c9274 (patch)
treeda3c2846fa04e4cbd7ef8aa72888aa6e3a55908f /libavutil/dict.c
parent652173f63f024baccd7f082292aba2ad735c4b9b (diff)
downloadffmpeg-a740263d7e7be5bb909ae83a44b21cc8cf8c9274.tar.gz
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>
Diffstat (limited to 'libavutil/dict.c')
-rw-r--r--libavutil/dict.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/dict.c b/libavutil/dict.c
index 8bb65a13fe..12035627f9 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -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)