You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
make the AVOption code work with strings instead of crash
Originally committed as revision 11140 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -159,7 +159,7 @@ const AVOption *av_set_string(void *obj, const char *name, const char *val){
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(((uint8_t*)obj) + o->offset, val, sizeof(val));
|
memcpy(((uint8_t*)obj) + o->offset, &val, sizeof(val));
|
||||||
return o;
|
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_out) *o_out= o;
|
||||||
|
|
||||||
if(o->type == FF_OPT_TYPE_STRING)
|
if(o->type == FF_OPT_TYPE_STRING)
|
||||||
return dst;
|
return *(void**)dst;
|
||||||
|
|
||||||
switch(o->type){
|
switch(o->type){
|
||||||
case FF_OPT_TYPE_FLAGS: snprintf(buf, buf_len, "0x%08X",*(int *)dst);break;
|
case FF_OPT_TYPE_FLAGS: snprintf(buf, buf_len, "0x%08X",*(int *)dst);break;
|
||||||
|
Reference in New Issue
Block a user