[FFmpeg-cvslog] ffmpeg: check return value of avcodec_parameters_from_context

Marton Balint git at videolan.org
Tue Oct 9 22:54:37 EEST 2018


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Oct  7 22:16:49 2018 +0200| [6e6ecdf44d621ee450bfeed008618cd5544187bb] | committer: Marton Balint

ffmpeg: check return value of avcodec_parameters_from_context

Fixes Coverity CID 1427273.

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6e6ecdf44d621ee450bfeed008618cd5544187bb
---

 fftools/ffmpeg.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 934dc71a74..aa495b5d9e 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -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;



More information about the ffmpeg-cvslog mailing list