mirror of https://git.ffmpeg.org/ffmpeg.git
lavu/opt: fix crash in av_opt_next() in case the class has no options
This commit is contained in:
parent
7fd467f708
commit
a6d6b8a200
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue