mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-27 21:40:34 +00:00
AVOptions: don't return an invalid option when option list is empty
This commit is contained in:
parent
45fcb86cf8
commit
e1e22851c1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user