aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/dict.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-10-14 14:01:11 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-10-14 14:01:11 +0200
commitb994788353ec39677d9f751da5cf754ef6247773 (patch)
tree9bb1153a5bb5680fc5bc7d1385d832ee70266026 /libavutil/dict.c
parentfcfb66ba9b6e8e8026fa38ea99e0458b31321217 (diff)
parent11c5f438ff83da5040e85bfa6299f56b321d32ef (diff)
downloadffmpeg-b994788353ec39677d9f751da5cf754ef6247773.tar.gz
Merge commit '11c5f438ff83da5040e85bfa6299f56b321d32ef'
* commit '11c5f438ff83da5040e85bfa6299f56b321d32ef': dict: Change return type of av_dict_copy() Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavutil/dict.c')
-rw-r--r--libavutil/dict.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavutil/dict.c b/libavutil/dict.c
index 6ff1af5215..8bb65a13fe 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -210,12 +210,17 @@ void av_dict_free(AVDictionary **pm)
av_freep(pm);
}
-void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
+int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
{
AVDictionaryEntry *t = NULL;
- while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX)))
- av_dict_set(dst, t->key, t->value, flags);
+ while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) {
+ int ret = av_dict_set(dst, t->key, t->value, flags);
+ if (ret < 0)
+ return ret;
+ }
+
+ return 0;
}
int av_dict_get_string(const AVDictionary *m, char **buffer,