diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-10-04 13:27:15 +0200 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-10-12 13:35:01 +0200 |
commit | 11c5f438ff83da5040e85bfa6299f56b321d32ef (patch) | |
tree | 8c2570de0ae47c60d02b67432aa326f2c4d0e3c9 /libavutil/dict.c | |
parent | c1aac39eaccd32dc3b74ccfcce701d3d888fbc6b (diff) | |
download | ffmpeg-11c5f438ff83da5040e85bfa6299f56b321d32ef.tar.gz |
dict: Change return type of av_dict_copy()
av_dict_set() could return an error, so forward it appropriately.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavutil/dict.c')
-rw-r--r-- | libavutil/dict.c | 11 |
1 files changed, 8 insertions, 3 deletions
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; } |