diff options
author | Lukasz Marek <lukasz.m.luki2@gmail.com> | 2014-11-23 00:48:17 +0100 |
---|---|---|
committer | Lukasz Marek <lukasz.m.luki2@gmail.com> | 2014-11-25 23:09:16 +0100 |
commit | ea0d8938173e12b289243c88c6a79dc6651e6ed9 (patch) | |
tree | 10dad812cf89e27af12663f3ae9438c2d3562144 /libavutil/opt.c | |
parent | 2a89afb376aebe833bee0b5958cec16c48936b03 (diff) | |
download | ffmpeg-ea0d8938173e12b289243c88c6a79dc6651e6ed9.tar.gz |
lavu/opt: handle NULL obj in av_opt_next
It indirectly also fixes av_opt_free for NULL objs.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index 0546a37b0f..5b26a00ead 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -50,7 +50,10 @@ const AVOption *av_next_option(void *obj, const AVOption *last) const AVOption *av_opt_next(void *obj, const AVOption *last) { - AVClass *class = *(AVClass**)obj; + const AVClass *class; + if (!obj) + return NULL; + class = *(const AVClass**)obj; if (!last && class && class->option && class->option[0].name) return class->option; if (last && last[1].name) |