diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-11-22 22:03:21 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-11-22 22:03:21 +0000 |
commit | 819e2ab0d8d65cee0e95c89c0a4eb77aa8237c75 (patch) | |
tree | ea906cb7a132ed395d1a68d0d1a7f77b05397e0e /cmdutils.c | |
parent | 902d49eef75d422344c0dad1b31c01a3b21380af (diff) | |
download | ffmpeg-819e2ab0d8d65cee0e95c89c0a4eb77aa8237c75.tar.gz |
Add missing check on the existence of avcodec_opts[AVMEDIA_TYPE_X],
fix crash in ffprobe.
Originally committed as revision 25799 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmdutils.c b/cmdutils.c index 681ed4244b..b2e6ee0081 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -228,11 +228,11 @@ int opt_default(const char *opt, const char *arg){ 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) { |