提交 e1e22851 编写于 作者: A Anton Khirnov

AVOptions: don't return an invalid option when option list is empty

上级 45fcb86c
......@@ -56,9 +56,10 @@ const AVOption *av_next_option(void *obj, const AVOption *last)
const AVOption *av_opt_next(void *obj, const AVOption *last)
{
if (last && last[1].name) return ++last;
else if (last) return NULL;
else return (*(AVClass**)obj)->option;
AVClass *class = *(AVClass**)obj;
if (!last && class->option[0].name) return class->option;
if (last && last[1].name) return ++last;
return NULL;
}
static int read_number(const AVOption *o, void *dst, double *num, int *den, int64_t *intnum)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册