diff options
author | wm4 <wm4@nowhere> | 2013-10-24 19:15:16 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-24 22:50:13 +0200 |
commit | cfc72d4fff568c214a465f150cb51255e34ef7f5 (patch) | |
tree | a84f7ee0c63968de8dd4918552fa22c32a30e53d | |
parent | 8d5f8d5a6b6730d761fc622d279cbe45341d3314 (diff) | |
download | mpv-cfc72d4fff568c214a465f150cb51255e34ef7f5.tar.bz2 mpv-cfc72d4fff568c214a465f150cb51255e34ef7f5.tar.xz |
m_config: slightly simplify dynamic option initialization
We can assume memcpy is enough, because the source should be from
static data. (It wouldn't work if the data could contain pointers
back into itself.)
-rw-r--r-- | mpvcore/m_config.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mpvcore/m_config.c b/mpvcore/m_config.c index 0affe0d6ee..267fc92bd4 100644 --- a/mpvcore/m_config.c +++ b/mpvcore/m_config.c @@ -427,10 +427,9 @@ static struct m_config_option *m_config_add_option(struct m_config *config, assert(0); } union m_option_value temp = {0}; - m_option_copy(arg, &temp, co->data); + memcpy(&temp, co->data, arg->type->size); memset(co->data, 0, arg->type->size); m_option_copy(arg, co->data, &temp); - m_option_free(arg, &temp); } } } |