Skip to content
Snippets Groups Projects
Commit d02202e0 authored by Justin Ruggles's avatar Justin Ruggles
Browse files

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

CC: libav-stable@libav.org
parent 5778299c
No related branches found
No related tags found
No related merge requests found
...@@ -37,8 +37,10 @@ ...@@ -37,8 +37,10 @@
const AVOption *av_opt_next(void *obj, const AVOption *last) const AVOption *av_opt_next(void *obj, const AVOption *last)
{ {
AVClass *class = *(AVClass**)obj; AVClass *class = *(AVClass**)obj;
if (!last && class->option[0].name) return class->option; if (!last && class->option && class->option[0].name)
if (last && last[1].name) return ++last; return class->option;
if (last && last[1].name)
return ++last;
return NULL; return NULL;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment