diff options
author | Lukasz Marek <lukasz.m.luki2@gmail.com> | 2014-11-08 18:12:56 +0100 |
---|---|---|
committer | Lukasz Marek <lukasz.m.luki2@gmail.com> | 2014-11-09 17:56:08 +0100 |
commit | 4e179436b6c859ae2e47ab088de8fc89b379a07b (patch) | |
tree | 892a43094ab1a31cdba7abbf7f6df7f1931a7a4f /libavutil/opt.c | |
parent | 457204ee15923cb401368702567ce78bf9f612d8 (diff) | |
download | ffmpeg-4e179436b6c859ae2e47ab088de8fc89b379a07b.tar.gz |
lavu/opt: copy dict in av_opt_copy
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index 6aabfe3137..fca5354971 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1595,6 +1595,15 @@ int av_opt_copy(void *dst, void *src) *(int*)(field_dst8 + 1) = len; } else if (o->type == AV_OPT_TYPE_CONST) { // do nothing + } else if (o->type == AV_OPT_TYPE_DICT) { + AVDictionary **sdict = (AVDictionary **) field_src; + AVDictionary **ddict = (AVDictionary **) field_dst; + 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); } else { memcpy(field_dst, field_src, opt_size(o->type)); } |