Commit bbc5adfb authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/opt: Fix parsing regression with constants starting with numbers

Fixes parsing "3dnow"

Found-by: jamrial
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a6132579
...@@ -206,12 +206,14 @@ static int set_string_number(void *obj, void *target_obj, const AVOption *o, con ...@@ -206,12 +206,14 @@ static int set_string_number(void *obj, void *target_obj, const AVOption *o, con
} }
{ {
const AVOption *o_named; const AVOption *o_named = av_opt_find(target_obj, buf, o->unit, 0, 0);
int res; int res;
int ci = 0; int ci = 0;
double const_values[64]; double const_values[64];
const char * const_names[64]; const char * const_names[64];
if (o_named && o_named->type == AV_OPT_TYPE_CONST)
d = DEFAULT_NUMVAL(o_named);
else {
if (o->unit) { if (o->unit) {
for (o_named = NULL; o_named = av_opt_next(target_obj, o_named); ) { for (o_named = NULL; o_named = av_opt_next(target_obj, o_named); ) {
if (o_named->type == AV_OPT_TYPE_CONST && if (o_named->type == AV_OPT_TYPE_CONST &&
...@@ -246,6 +248,7 @@ static int set_string_number(void *obj, void *target_obj, const AVOption *o, con ...@@ -246,6 +248,7 @@ static int set_string_number(void *obj, void *target_obj, const AVOption *o, con
return res; return res;
} }
} }
}
if (o->type == AV_OPT_TYPE_FLAGS) { if (o->type == AV_OPT_TYPE_FLAGS) {
read_number(o, dst, NULL, NULL, &intnum); read_number(o, dst, NULL, NULL, &intnum);
if (cmd == '+') d = intnum | (int64_t)d; if (cmd == '+') d = intnum | (int64_t)d;
......
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