Commit d02202e0 authored by Justin Ruggles's avatar Justin Ruggles

opt: avoid segfault in av_opt_next() if the class does not have an option list

CC: libav-stable@libav.org
parent 5778299c
......@@ -37,8 +37,10 @@
const AVOption *av_opt_next(void *obj, const AVOption *last)
{
AVClass *class = *(AVClass**)obj;
if (!last && class->option[0].name) return class->option;
if (last && last[1].name) return ++last;
if (!last && class->option && class->option[0].name)
return class->option;
if (last && last[1].name)
return ++last;
return NULL;
}
......
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