mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
opt: avoid segfault in av_opt_next() if the class does not have an option list
CC: libav-stable@libav.org
This commit is contained in:
parent
5778299c7e
commit
d02202e08a
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user