[FFmpeg-cvslog] ffmpeg_opt: Check for av_realloc_array() failure

Michael Niedermayer git at videolan.org
Wed Jan 7 18:23:16 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jan  7 18:09:52 2015 +0100| [7efabffc2899b76688a40b4bd7c63370eb2d8ca8] | committer: Michael Niedermayer

ffmpeg_opt: Check for av_realloc_array() failure

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

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

 ffmpeg_opt.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 7594b34..dcd751d 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1381,10 +1381,11 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
                 av_log(NULL, AV_LOG_FATAL, "error parsing rc_override\n");
                 exit_program(1);
             }
-            /* FIXME realloc failure */
             video_enc->rc_override =
                 av_realloc_array(video_enc->rc_override,
                                  i + 1, sizeof(RcOverride));
+            if (!video_enc->rc_override)
+                exit_program(1);
             video_enc->rc_override[i].start_frame = start;
             video_enc->rc_override[i].end_frame   = end;
             if (q > 0) {



More information about the ffmpeg-cvslog mailing list