aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/opt.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-12-03 01:03:54 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-12-03 01:03:54 +0000
commit24cdc39e9dfd2b98e96c96387903bd41313bd0dd (patch)
tree37eca6a1448b34a629a531179be7d1770b7f860e /libavcodec/opt.c
parent1fe47470d17c8b1e31e9eddb975bc61768f7dc94 (diff)
downloadffmpeg-24cdc39e9dfd2b98e96c96387903bd41313bd0dd.tar.gz
make the AVOption code work with strings instead of crash
Originally committed as revision 11140 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/opt.c')
-rw-r--r--libavcodec/opt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/opt.c b/libavcodec/opt.c
index deddfd1cd9..e43e0c1505 100644
--- a/libavcodec/opt.c
+++ b/libavcodec/opt.c
@@ -159,7 +159,7 @@ const AVOption *av_set_string(void *obj, const char *name, const char *val){
return NULL;
}
- memcpy(((uint8_t*)obj) + o->offset, val, sizeof(val));
+ memcpy(((uint8_t*)obj) + o->offset, &val, sizeof(val));
return o;
}
@@ -192,7 +192,7 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c
if(o_out) *o_out= o;
if(o->type == FF_OPT_TYPE_STRING)
- return dst;
+ return *(void**)dst;
switch(o->type){
case FF_OPT_TYPE_FLAGS: snprintf(buf, buf_len, "0x%08X",*(int *)dst);break;