Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-06-30 22:06:40 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-23 02:36:10 +0300
commit32df1cd6ac09bc52d5a4cadf4053aeb113472f8d (patch)
tree0aaf95bf4f247a72fb12c5cdf89f18f15a4b607c
parenta0f50ddcb83117a7202f0e65e0416b4f6e4ef383 (diff)
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> (cherry picked from commit cd64ead8d96b2d2c300e0ac620fb82b17d6051bf) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Conflicts: ffmpeg.c (cherry picked from commit 1d1adf5ff42041810d4069ce03303706fbf13d8a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--ffmpeg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 2c757bd5a4..2612bebd88 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1844,6 +1844,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) {
if (!pkt->size) {
for (i = 0; i < ist->nb_filters; i++)
@@ -1989,6 +1992,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 ||
@@ -2107,6 +2113,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);