Commit 7cd6d61d authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/opt: try to fix the case where src==dst in av_opt_copy()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fa6716c6
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment