[FFmpeg-cvslog] r25179 - trunk/cmdutils.c

stefano subversion
Fri Sep 24 18:32:08 CEST 2010


Author: stefano
Date: Fri Sep 24 18:32:08 2010
New Revision: 25179

Log:
Add missing existence checks in opt_default().

Modified:
   trunk/cmdutils.c

Modified: trunk/cmdutils.c
==============================================================================
--- trunk/cmdutils.c	Fri Sep 24 18:18:40 2010	(r25178)
+++ trunk/cmdutils.c	Fri Sep 24 18:32:08 2010	(r25179)
@@ -198,12 +198,12 @@ int opt_default(const char *opt, const c
     const AVOption *o= NULL;
     int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0};
 
-    for(type=0; type<AVMEDIA_TYPE_NB && ret>= 0; type++){
+    for(type=0; *avcodec_opts && type<AVMEDIA_TYPE_NB && ret>= 0; type++){
         const AVOption *o2 = av_find_opt(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]);
         if(o2)
             ret = av_set_string3(avcodec_opts[type], opt, arg, 1, &o);
     }
-    if(!o)
+    if(!o && avformat_opts)
         ret = av_set_string3(avformat_opts, opt, arg, 1, &o);
     if(!o && sws_opts)
         ret = av_set_string3(sws_opts, opt, arg, 1, &o);



More information about the ffmpeg-cvslog mailing list