projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45fcb86
)
AVOptions: don't return an invalid option when option list is empty
author
Anton Khirnov
<anton@khirnov.net>
Thu, 10 Nov 2011 08:19:09 +0000
(09:19 +0100)
committer
Anton Khirnov
<anton@khirnov.net>
Fri, 11 Nov 2011 07:27:16 +0000
(08:27 +0100)
libavutil/opt.c
patch
|
blob
|
history
diff --git
a/libavutil/opt.c
b/libavutil/opt.c
index
aa76301
..
7c53024
100644
(file)
--- a/
libavutil/opt.c
+++ b/
libavutil/opt.c
@@
-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)