lavu/opt: handle NULL obj in av_opt_next
It indirectly also fixes av_opt_free for NULL objs. Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
This commit is contained in:
parent
2a89afb376
commit
ea0d893817
@ -50,7 +50,10 @@ const AVOption *av_next_option(void *obj, const AVOption *last)
|
||||
|
||||
const AVOption *av_opt_next(void *obj, const AVOption *last)
|
||||
{
|
||||
AVClass *class = *(AVClass**)obj;
|
||||
const AVClass *class;
|
||||
if (!obj)
|
||||
return NULL;
|
||||
class = *(const AVClass**)obj;
|
||||
if (!last && class && class->option && class->option[0].name)
|
||||
return class->option;
|
||||
if (last && last[1].name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user