From 3ebff7dc62f6fb93d9635dd052c1140ddcc63dc7 Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Tue, 20 Dec 2016 11:13:55 +0530 Subject: [PATCH] Decoder: Fix in error concealment in the case of Mbaff clips In case of MBAff clips, if error is detected after parsing odd MB, then treat that odd MB also as error. All MBAff processing is done as an MB-Pair. Bug: 33298089 --- decoder/ih264d_parse_pslice.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c index ba72fcf..f5113f5 100644 --- a/decoder/ih264d_parse_pslice.c +++ b/decoder/ih264d_parse_pslice.c @@ -1583,8 +1583,13 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec, { // Slice data corrupted // in the case of mbaff, conceal from the even mb. - u1_num_mbs = (ps_dec->u4_num_mbs_cur_nmb >> u1_mbaff ) << u1_mbaff; + if((u1_mbaff) && (ps_dec->u4_num_mbs_cur_nmb & 1)) + { + ps_dec->u4_num_mbs_cur_nmb = ps_dec->u4_num_mbs_cur_nmb - 1; + ps_dec->u2_cur_mb_addr--; + } + u1_num_mbs = ps_dec->u4_num_mbs_cur_nmb; if(u1_num_mbs) { ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs - 1;