Ensure ih264d_start_of_pic() is not repeated in ih264d_mark_err_slice_skip()

In case of error in handling MMCO commpands/reference list creation,
ih264d_start_of_pic() was called again in ih264d_mark_err_slice_skip() resulting in
leaking a picture or an MV buffer in buffer manager.

To fix this, ensure prev_slice_err is set to 1 only if u4_pic_buf_got is zero, before
calling ih264d_mark_err_slice_skip() at the end of picture decode.
This will ensure ih264d_start_of_pic() is not repeated

Bug: 25818142

Change-Id: I7d5a9179533581eec663bc6a19a2901e7cce6af3
This commit is contained in:
Harish Mahendrakar 2016-02-01 15:08:19 +05:30 committed by mspector@google.com
parent 943323f1d9
commit c7a1cf4e0b

View file

@ -3087,7 +3087,7 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
num_mb_skipped = (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
- ps_dec->u2_total_mbs_coded;
if(ps_dec->u4_first_slice_in_pic)
if(ps_dec->u4_first_slice_in_pic && (ps_dec->u4_pic_buf_got == 0))
prev_slice_err = 1;
else
prev_slice_err = 2;
@ -3114,8 +3114,11 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
{
ih264d_signal_bs_deblk_thread(ps_dec);
}
/* dont consume bitstream */
ps_dec_op->u4_num_bytes_consumed -= bytes_consumed;
/* dont consume bitstream for change in resolution case */
if(ret == IVD_RES_CHANGED)
{
ps_dec_op->u4_num_bytes_consumed -= bytes_consumed;
}
return IV_FAIL;
}