[FFmpeg-cvslog] opt: Fix *av_opt_find2(NULL)

Michael Niedermayer git at videolan.org
Tue Nov 15 23:01:06 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Nov 15 22:43:21 2011 +0100| [d5e1244ca7731820639849924c77e65eeaea5089] | committer: Michael Niedermayer

opt: Fix *av_opt_find2(NULL)
Fixes Ticket650

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavutil/opt.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 2421ee8..ca31be3 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -753,9 +753,14 @@ const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
 const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
                              int opt_flags, int search_flags, void **target_obj)
 {
-    const AVClass  *c = *(AVClass**)obj;
+    const AVClass  *c;
     const AVOption *o = NULL;
 
+    if(!obj)
+        return NULL;
+
+    c= *(AVClass**)obj;
+
     if (search_flags & AV_OPT_SEARCH_CHILDREN) {
         if (search_flags & AV_OPT_SEARCH_FAKE_OBJ) {
             const AVClass *child = NULL;



More information about the ffmpeg-cvslog mailing list