diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-05-11 22:41:15 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-06-08 12:52:50 +0200 |
commit | 7e03d962a43b33811f6c0f09e72926e7684e96e8 (patch) | |
tree | 165438c8c673f9c586c25df7a662f37154651c39 | |
parent | cbf6047c83c8142dd13fabd07906a844f4165f19 (diff) |
avutil/opt: Check directly for av_dict_copy() failure
av_dict_copy() returned void when this code was written.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavutil/opt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index 4124efd9b6..41284d4ecd 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1807,12 +1807,13 @@ int av_opt_copy(void *dst, const void *src) } else if (o->type == AV_OPT_TYPE_DICT) { AVDictionary **sdict = (AVDictionary **) field_src; AVDictionary **ddict = (AVDictionary **) field_dst; + int ret2; if (*sdict != *ddict) av_dict_free(ddict); *ddict = NULL; - av_dict_copy(ddict, *sdict, 0); - if (av_dict_count(*sdict) != av_dict_count(*ddict)) - ret = AVERROR(ENOMEM); + ret2 = av_dict_copy(ddict, *sdict, 0); + if (ret2 < 0) + ret = ret2; } else { int size = opt_size(o->type); if (size < 0) |