ffmpeg_opt: Check for av_realloc_array() failure
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 7 Jan 2015 17:09:52 +0000 (18:09 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 7 Jan 2015 17:22:37 +0000 (18:22 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg_opt.c

index 7594b34..dcd751d 100644 (file)
@@ -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) {