[FFmpeg-cvslog] ffmpeg: check av_opt_set_dict() return

Michael Niedermayer git at videolan.org
Wed Jul 2 06:30:34 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jul  2 05:20:26 2014 +0200| [4930cd13d634d5f4e284de3a955d5c6a84fd65e2] | committer: Michael Niedermayer

ffmpeg: check av_opt_set_dict() return

Fixes CID1224275

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 ffmpeg.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 3d23ee6..4941c84 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2864,7 +2864,11 @@ static int transcode_init(void)
                 av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
                                              " It takes bits/s as argument, not kbits/s\n");
         } else {
-            av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);
+            if (av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts) < 0) {
+                av_log(NULL, AV_LOG_FATAL,
+                    "Error setting up codec context options.\n");
+                exit_program(1);
+            }
         }
 
         ret = avcodec_copy_context(ost->st->codec, ost->enc_ctx);



More information about the ffmpeg-cvslog mailing list