aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-08-15 00:37:31 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-08-15 00:37:31 +0000
commit266649a52fe258c09bbe5d2e222431c6a864af3f (patch)
treea94490b2c717ea2a13220fcdd915a304eedd51a5 /ffmpeg.c
parentffbe087b589506cb0e671fa711e5c2c6ea203ac0 (diff)
downloadffmpeg-266649a52fe258c09bbe5d2e222431c6a864af3f.tar.gz
100l, error out if subtitle encoder failed instead of writing an AVPacket
with ridiculous size and thus crashing. Originally committed as revision 19641 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index e5512c2880..2686e1d09c 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -828,6 +828,10 @@ static void do_subtitle_out(AVFormatContext *s,
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;