Decoder: Fix end of bitstream error.

The end of bistream error check was fixed for
odd number of macroblocks in Mbaff frames.

Bug: 37008096
Test: Ittiam-verified
Change-Id: I058d74a3c1d1511968c2b36802dfc5c102947919
This commit is contained in:
Hamsalekha S 2017-02-10 14:44:43 +05:30 committed by Ray Essick
parent 0015860fdc
commit 2e01924cd6
2 changed files with 24 additions and 5 deletions

View file

@ -867,6 +867,8 @@ WORD32 ih264d_parse_islice_data_cavlc(dec_struct_t * ps_dec,
ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
}
uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
if(u1_mbaff)
{
ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
@ -880,7 +882,7 @@ WORD32 ih264d_parse_islice_data_cavlc(dec_struct_t * ps_dec,
/**************************************************************/
i2_cur_mb_addr++;
uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
/* Store the colocated information */
{
@ -1089,8 +1091,7 @@ WORD32 ih264d_parse_islice_data_cabac(dec_struct_t * ps_dec,
{
ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
}
/* Next macroblock information */
i2_cur_mb_addr++;
if(ps_cur_mb_info->u1_topmb && u1_mbaff)
uc_more_data_flag = 1;
@ -1101,6 +1102,16 @@ WORD32 ih264d_parse_islice_data_cabac(dec_struct_t * ps_dec,
uc_more_data_flag = !uc_more_data_flag;
COPYTHECONTEXT("Decode Sliceterm",!uc_more_data_flag);
}
if(u1_mbaff)
{
if(!uc_more_data_flag && (0 == (i2_cur_mb_addr & 1)))
{
return ERROR_EOB_FLUSHBITS_T;
}
}
/* Next macroblock information */
i2_cur_mb_addr++;
/* Store the colocated information */
{

View file

@ -1007,8 +1007,7 @@ WORD32 ih264d_parse_inter_slice_data_cabac(dec_struct_t * ps_dec,
{
ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
}
/* Next macroblock information */
i2_cur_mb_addr++;
if(ps_cur_mb_info->u1_topmb && u1_mbaff)
uc_more_data_flag = 1;
@ -1020,6 +1019,15 @@ WORD32 ih264d_parse_inter_slice_data_cabac(dec_struct_t * ps_dec,
COPYTHECONTEXT("Decode Sliceterm",!uc_more_data_flag);
}
if(u1_mbaff)
{
if(!uc_more_data_flag && (0 == (i2_cur_mb_addr & 1)))
{
return ERROR_EOB_FLUSHBITS_T;
}
}
/* Next macroblock information */
i2_cur_mb_addr++;
u1_num_mbs++;
u1_num_mbsNby2++;
ps_parse_mb_data++;