[FFmpeg-cvslog] lavu/opt: fix crash in av_opt_next() in case the class has no options
Stefano Sabatini
git at videolan.org
Fri Aug 10 23:22:22 CEST 2012
ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Thu Aug 9 11:50:58 2012 +0200| [a6d6b8a20072a5919d38258dd48cc612e2372f81] | committer: Stefano Sabatini
lavu/opt: fix crash in av_opt_next() in case the class has no options
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a6d6b8a20072a5919d38258dd48cc612e2372f81
---
libavutil/opt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavutil/opt.c b/libavutil/opt.c
index cdd5276..02869e4 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -59,7 +59,8 @@ const AVOption *av_next_option(void *obj, const AVOption *last)
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 && class->option && class->option[0].name)
+ return class->option;
if (last && last[1].name) return ++last;
return NULL;
}
More information about the ffmpeg-cvslog
mailing list