[FFmpeg-cvslog] lavu/opt: handle NULL obj in av_opt_next

Lukasz Marek git at videolan.org
Tue Nov 25 23:10:38 CET 2014


ffmpeg | branch: master | Lukasz Marek <lukasz.m.luki2 at gmail.com> | Sun Nov 23 00:48:17 2014 +0100| [ea0d8938173e12b289243c88c6a79dc6651e6ed9] | committer: Lukasz Marek

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 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea0d8938173e12b289243c88c6a79dc6651e6ed9
---

 libavutil/opt.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 0546a37..5b26a00 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)



More information about the ffmpeg-cvslog mailing list