ffmpeg: check return value of avcodec_parameters_from_context

Fixes Coverity CID 1427273.

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2018-10-07 22:16:49 +02:00
parent 4db291d764
commit 6e6ecdf44d
1 changed files with 7 additions and 1 deletions

View File

@ -3072,7 +3072,13 @@ static int init_output_stream_streamcopy(OutputStream *ost)
"Error setting up codec context options.\n");
return ret;
}
avcodec_parameters_from_context(par_src, ost->enc_ctx);
ret = avcodec_parameters_from_context(par_src, ost->enc_ctx);
if (ret < 0) {
av_log(NULL, AV_LOG_FATAL,
"Error getting reference codec parameters.\n");
return ret;
}
if (!codec_tag) {
unsigned int codec_tag_tmp;