diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-06-30 21:06:40 +0200 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-07-01 00:32:50 +0200 |
commit | cd64ead8d96b2d2c300e0ac620fb82b17d6051bf (patch) | |
tree | 9bc36f53c501ead0c1167d83919632538c66d166 /ffmpeg.c | |
parent | 32a5b631267e1f8bf279e407039b9a99d012d033 (diff) | |
download | ffmpeg-streaming-cd64ead8d96b2d2c300e0ac620fb82b17d6051bf.zip ffmpeg-streaming-cd64ead8d96b2d2c300e0ac620fb82b17d6051bf.tar.gz |
ffmpeg: exit_on_error if decoding a packet failed
This is the second part of the fix for ticket #4370.
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1873,6 +1873,9 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output) if (*got_output || ret<0 || pkt->size) decode_error_stat[ret<0] ++; + if (ret < 0 && exit_on_error) + exit_program(1); + if (!*got_output || ret < 0) return ret; @@ -2009,6 +2012,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output) if (*got_output || ret<0 || pkt->size) decode_error_stat[ret<0] ++; + if (ret < 0 && exit_on_error) + exit_program(1); + if (*got_output && ret >= 0) { if (ist->dec_ctx->width != decoded_frame->width || ist->dec_ctx->height != decoded_frame->height || @@ -2118,6 +2124,9 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output) if (*got_output || ret<0 || pkt->size) decode_error_stat[ret<0] ++; + if (ret < 0 && exit_on_error) + exit_program(1); + if (ret < 0 || !*got_output) { if (!pkt->size) sub2video_flush(ist); |