lavu/opt: check if class is NULL too

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pull/18/merge
Paul B Mahol 12 years ago
parent 39dc1bc90f
commit f98dbc7311
  1. 2
      libavutil/opt.c

@ -63,7 +63,7 @@ const AVOption *av_next_option(void *obj, const AVOption *last)
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 && class->option[0].name) if (!last && class && class->option && class->option[0].name)
return class->option; return class->option;
if (last && last[1].name) if (last && last[1].name)
return ++last; return ++last;

Loading…
Cancel
Save