[FFmpeg-cvslog] AVOptions: don't return an invalid option when option list is empty
Anton Khirnov
git at videolan.org
Sat Nov 12 03:02:01 CET 2011
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Nov 10 09:19:09 2011 +0100| [e1e22851c15b2b88de111353f53fe4c94431f883] | committer: Anton Khirnov
AVOptions: don't return an invalid option when option list is empty
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1e22851c15b2b88de111353f53fe4c94431f883
---
libavutil/opt.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavutil/opt.c b/libavutil/opt.c
index aa76301..7c53024 100644
--- 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)
More information about the ffmpeg-cvslog
mailing list