aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-17 05:56:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-17 06:21:42 +0200
commit7cd6d61da53cad48703e6bf9e6aad003f1dfec20 (patch)
treee1a3228ef866bd1a8d7b10546e9e89c0b213f2c8
parentfa6716c66d31385a0f306c2a3f46f44e0d928ff9 (diff)
downloadffmpeg-7cd6d61da53cad48703e6bf9e6aad003f1dfec20.tar.gz
avutil/opt: try to fix the case where src==dst in av_opt_copy()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/opt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 694295dc35..505e0103db 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1559,7 +1559,9 @@ int av_opt_copy(void *dst, void *src)
uint8_t **field_src8 = (uint8_t**)field_src;
if (o->type == AV_OPT_TYPE_STRING) {
- set_string(dst, o, *field_src8, field_dst8);
+ if (*field_dst8 != *field_src8)
+ av_freep(field_dst8);
+ *field_dst8 = av_strdup(*field_src8);
if (*field_src8 && !*field_dst8)
ret = AVERROR(ENOMEM);
} else if (o->type == AV_OPT_TYPE_BINARY) {