Browse Source

opt: avoid segfault in av_opt_next() if the class does not have an option list

CC: libav-stable@libav.org
tags/n1.1
Justin Ruggles 12 years ago
parent
commit
d02202e08a
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      libavutil/opt.c

+ 4
- 2
libavutil/opt.c View File

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