[FFmpeg-cvslog] r19641 - trunk/ffmpeg.c

reimar subversion
Sat Aug 15 02:37:31 CEST 2009


Author: reimar
Date: Sat Aug 15 02:37:31 2009
New Revision: 19641

Log:
100l, error out if subtitle encoder failed instead of writing an AVPacket
with ridiculous size and thus crashing.

Modified:
   trunk/ffmpeg.c

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	Sat Aug 15 02:02:42 2009	(r19640)
+++ trunk/ffmpeg.c	Sat Aug 15 02:37:31 2009	(r19641)
@@ -828,6 +828,10 @@ static void do_subtitle_out(AVFormatCont
         sub->pts = av_rescale_q(pts, ist->st->time_base, AV_TIME_BASE_Q);
         subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out,
                                                     subtitle_out_max_size, sub);
+        if (subtitle_out_size < 0) {
+            fprintf(stderr, "Subtitle encoding failed\n");
+            av_exit(1);
+        }
 
         av_init_packet(&pkt);
         pkt.stream_index = ost->index;



More information about the ffmpeg-cvslog mailing list