Commit a6d6b8a2 authored by Stefano Sabatini's avatar Stefano Sabatini

lavu/opt: fix crash in av_opt_next() in case the class has no options

parent 7fd467f7
......@@ -59,7 +59,8 @@ const AVOption *av_next_option(void *obj, const AVOption *last)
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 && 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