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

stefano subversion
Mon Nov 22 23:03:21 CET 2010


Author: stefano
Date: Mon Nov 22 23:03:21 2010
New Revision: 25799

Log:
Add missing check on the existence of avcodec_opts[AVMEDIA_TYPE_X],
fix crash in ffprobe.

Modified:
   trunk/cmdutils.c

Modified: trunk/cmdutils.c
==============================================================================
--- trunk/cmdutils.c	Mon Nov 22 21:42:08 2010	(r25798)
+++ trunk/cmdutils.c	Mon Nov 22 23:03:21 2010	(r25799)
@@ -228,11 +228,11 @@ int opt_default(const char *opt, const c
     if(!o && sws_opts)
         ret = av_set_string3(sws_opts, opt, arg, 1, &o);
     if(!o){
-        if(opt[0] == 'a')
+        if (opt[0] == 'a' && avcodec_opts[AVMEDIA_TYPE_AUDIO])
             ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_AUDIO], opt+1, arg, 1, &o);
-        else if(opt[0] == 'v')
+        else if(opt[0] == 'v' && avcodec_opts[AVMEDIA_TYPE_VIDEO])
             ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 1, &o);
-        else if(opt[0] == 's')
+        else if(opt[0] == 's' && avcodec_opts[AVMEDIA_TYPE_SUBTITLE])
             ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], opt+1, arg, 1, &o);
     }
     if (o && ret < 0) {



More information about the ffmpeg-cvslog mailing list