mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-16 03:50:05 +01:00
avformat/utils: Check avcodec_open2() return code in av_find_stream_info()
Fixes CID1135750 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -2857,15 +2857,16 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
|||||||
|
|
||||||
/* Ensure that subtitle_header is properly set. */
|
/* Ensure that subtitle_header is properly set. */
|
||||||
if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE
|
if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE
|
||||||
&& codec && !st->codec->codec)
|
&& codec && !st->codec->codec) {
|
||||||
avcodec_open2(st->codec, codec, options ? &options[i]
|
if (avcodec_open2(st->codec, codec, options ? &options[i] : &thread_opt) < 0)
|
||||||
: &thread_opt);
|
av_log(ic, AV_LOG_WARNING, "Failed to open codec in av_find_stream_info\n");
|
||||||
|
}
|
||||||
|
|
||||||
//try to just open decoders, in case this is enough to get parameters
|
//try to just open decoders, in case this is enough to get parameters
|
||||||
if (!has_codec_parameters(st, NULL) && st->request_probe <= 0) {
|
if (!has_codec_parameters(st, NULL) && st->request_probe <= 0) {
|
||||||
if (codec && !st->codec->codec)
|
if (codec && !st->codec->codec)
|
||||||
avcodec_open2(st->codec, codec, options ? &options[i]
|
if (avcodec_open2(st->codec, codec, options ? &options[i] : &thread_opt) < 0)
|
||||||
: &thread_opt);
|
av_log(ic, AV_LOG_WARNING, "Failed to open codec in av_find_stream_info\n");
|
||||||
}
|
}
|
||||||
if (!options)
|
if (!options)
|
||||||
av_dict_free(&thread_opt);
|
av_dict_free(&thread_opt);
|
||||||
|
|||||||
Reference in New Issue
Block a user