opt_find: fix segfault
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Aug 2011 23:04:53 +0000 (01:04 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Aug 2011 23:06:15 +0000 (01:06 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/options.c

index d201072..78c2f72 100644 (file)
@@ -45,7 +45,7 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit, i
     AVCodec        *c = NULL;
 
     if (s->priv_data) {
-        if (s->codec->priv_class)
+        if (s->codec && s->codec->priv_class)
             return av_opt_find(s->priv_data, name, unit, opt_flags, search_flags);
         return NULL;
     }