summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-12-26 20:25:23 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-12-26 20:45:23 +0100
commit11103a493de5f07a61c6f4f1c37a290fdc8942cb (patch)
treebb53fc4f9405af8e21d0359d1f2b751e1662ea80 /ffmpeg.c
parent2f347c17d64624bf38b0957a3ddffbe7eeffe82a (diff)
ffmpeg: Check avcodec_parameters_to_context() for failure
Fixes CID1396241 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index e4890a4034..ec9da3e6e2 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2877,8 +2877,9 @@ static int init_output_stream_streamcopy(OutputStream *ost)
av_assert0(ist && !ost->filter);
- avcodec_parameters_to_context(ost->enc_ctx, ist->st->codecpar);
- ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);
+ ret = avcodec_parameters_to_context(ost->enc_ctx, ist->st->codecpar);
+ if (ret >= 0)
+ ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);
if (ret < 0) {
av_log(NULL, AV_LOG_FATAL,
"Error setting up codec context options.\n");