From 11c5f438ff83da5040e85bfa6299f56b321d32ef Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Sun, 4 Oct 2015 13:27:15 +0200 Subject: dict: Change return type of av_dict_copy() av_dict_set() could return an error, so forward it appropriately. Signed-off-by: Vittorio Giovara --- libavutil/dict.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'libavutil/dict.c') diff --git a/libavutil/dict.c b/libavutil/dict.c index 7f4832092a..7213bf2519 100644 --- a/libavutil/dict.c +++ b/libavutil/dict.c @@ -186,10 +186,15 @@ 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; } -- cgit v1.2.3