summaryrefslogtreecommitdiff
path: root/libavcodec/error_resilience.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-18 14:20:16 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-18 14:37:12 +0200
commit7d776062f97d14d5d9db96764f4785c91fb3e1f2 (patch)
tree3a8378183ad865e8ca4b87032c247dbb2c6c14b0 /libavcodec/error_resilience.c
parent70967a60dff4eec9e06822bf464a39a8dd3dc9c9 (diff)
avcodec/error_resilience: Fix handling of matrox mpeg2
Fixes Ticket2615 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/error_resilience.c')
-rw-r--r--libavcodec/error_resilience.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index c9f5e1f6b5..9c3b505371 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -860,6 +860,21 @@ void ff_er_frame_end(ERContext *s)
(s->avctx->skip_top + s->avctx->skip_bottom)) {
return;
}
+ for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
+ int status = s->error_status_table[mb_x + (s->mb_height - 1) * s->mb_stride];
+ if (status != 0x7F)
+ break;
+ }
+
+ if ( mb_x == s->mb_width
+ && s->avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO
+ && (s->avctx->height&16)
+ && s->error_count == 3 * s->mb_width * (s->avctx->skip_top + s->avctx->skip_bottom + 1)
+ ) {
+ av_log(s->avctx, AV_LOG_DEBUG, "ignoring last missing slice\n");
+ return;
+ }
+
if (s->last_pic) {
if (s->last_pic->f.width != s->cur_pic->f.width ||
s->last_pic->f.height != s->cur_pic->f.height ||