Commit 819e2ab0 authored by Stefano Sabatini's avatar Stefano Sabatini
Browse files

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
parent 902d49ee
...@@ -228,11 +228,11 @@ int opt_default(const char *opt, const char *arg){ ...@@ -228,11 +228,11 @@ int opt_default(const char *opt, const char *arg){
if(!o && sws_opts) if(!o && sws_opts)
ret = av_set_string3(sws_opts, opt, arg, 1, &o); ret = av_set_string3(sws_opts, opt, arg, 1, &o);
if(!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); 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); 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); ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], opt+1, arg, 1, &o);
} }
if (o && ret < 0) { if (o && ret < 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment