[FFmpeg-cvslog] ffmpeg: Check for subtitle_out malloc failure

Michael Niedermayer git at videolan.org
Mon Dec 15 23:37:43 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Dec 15 23:26:54 2014 +0100| [d2f9aefbde5bebac1af9eb6f3c41250fb8d5c0c0] | committer: Michael Niedermayer

ffmpeg: Check for subtitle_out malloc failure

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

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

 ffmpeg.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index d38c904..9f29eac 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -819,6 +819,10 @@ static void do_subtitle_out(AVFormatContext *s,
 
     if (!subtitle_out) {
         subtitle_out = av_malloc(subtitle_out_max_size);
+        if (!subtitle_out) {
+            av_log(NULL, AV_LOG_FATAL, "Failed to allocate subtitle_out\n");
+            exit_program(1);
+        }
     }
 
     /* Note: DVB subtitle need one packet to draw them and one other



More information about the ffmpeg-cvslog mailing list