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

Fixes parsing "3dnow"

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/79/head
Michael Niedermayer 11 years ago
parent a61325798a
commit bbc5adfb94
  1. 7
      libavutil/opt.c

@ -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 ci = 0;
double const_values[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) {
for (o_named = NULL; o_named = av_opt_next(target_obj, o_named); ) {
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
return res;
}
}
}
if (o->type == AV_OPT_TYPE_FLAGS) {
read_number(o, dst, NULL, NULL, &intnum);
if (cmd == '+') d = intnum | (int64_t)d;

Loading…
Cancel
Save