# HG changeset patch # User michael # Date 1196643834 0 # Node ID 58ee364cd8fb35127c5d55d548892e209e728235 # Parent 04f8a627587b0ca591a866120fc568ab5b8abeeb make the AVOption code work with strings instead of crash diff -r 04f8a627587b -r 58ee364cd8fb opt.c --- a/opt.c Sun Dec 02 22:04:21 2007 +0000 +++ b/opt.c Mon Dec 03 01:03:54 2007 +0000 @@ -159,7 +159,7 @@ 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 @@ 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;