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>
pull/100/head
Lukasz Marek 10 years ago
parent 2a89afb376
commit ea0d893817
  1. 5
      libavutil/opt.c

@ -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…
Cancel
Save