diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-08-09 11:50:58 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-08-10 23:14:37 +0200 |
commit | a6d6b8a20072a5919d38258dd48cc612e2372f81 (patch) | |
tree | 615deb6ab7840ae7f88dc2c99572437a359ed2a0 /libavutil/opt.c | |
parent | 7fd467f708060eb8996f2090120ca7dcb3fd9ce0 (diff) | |
download | ffmpeg-a6d6b8a20072a5919d38258dd48cc612e2372f81.tar.gz |
lavu/opt: fix crash in av_opt_next() in case the class has no options
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index cdd52768da..02869e44c7 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; } |