diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-11-08 18:35:49 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-12-22 15:43:27 -0500 |
commit | d02202e08a994c6c80f0256ae756698541b59902 (patch) | |
tree | ef9ecb70ba6ac4339785abe4f2fbc0fe98e8c4a2 | |
parent | 5778299c7ed3f82c624589bd35c82f597a8e0b64 (diff) | |
download | ffmpeg-d02202e08a994c6c80f0256ae756698541b59902.tar.gz |
opt: avoid segfault in av_opt_next() if the class does not have an option list
CC: libav-stable@libav.org
-rw-r--r-- | libavutil/opt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index e199170075..8a98a9ef55 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -37,8 +37,10 @@ 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 && last[1].name) return ++last; + if (!last && class->option && class->option[0].name) + return class->option; + if (last && last[1].name) + return ++last; return NULL; } |