[FFmpeg-devel] [PATCH] lavu/opt: fix crash in av_opt_next() in case the class has no options
Stefano Sabatini
stefasab at gmail.com
Thu Aug 9 22:58:03 CEST 2012
---
libavutil/opt.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
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;
}
--
1.7.5.4
More information about the ffmpeg-devel
mailing list