From 3a419eac8d70cc2ef517d3aa7f9c40c4b7d98cbe Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Thu, 26 May 2016 10:46:21 +0530 Subject: [PATCH 1/3] Decoder: Do not conceal slices with invalid SPS/PPS Bug: 28835995 --- decoder/ih264d_api.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c index 4123f3f..a8dea4f 100644 --- a/decoder/ih264d_api.c +++ b/decoder/ih264d_api.c @@ -3051,8 +3051,10 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) if((ret == IVD_RES_CHANGED) || (ret == IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED) || (ret == ERROR_UNAVAIL_PICBUF_T) - || (ret == ERROR_UNAVAIL_MVBUF_T)) + || (ret == ERROR_UNAVAIL_MVBUF_T) + || (ret == ERROR_INV_SPS_PPS_T)) { + ps_dec->u4_slice_start_code_found = 0; break; } @@ -3133,7 +3135,8 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) if((ret == IVD_RES_CHANGED) || (ret == IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED) || (ret == ERROR_UNAVAIL_PICBUF_T) - || (ret == ERROR_UNAVAIL_MVBUF_T)) + || (ret == ERROR_UNAVAIL_MVBUF_T) + || (ret == ERROR_INV_SPS_PPS_T)) { /* signal the decode thread */ From 7a54468cf8b56745d371baf83694c87a563907fc Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Mon, 13 Jun 2016 11:58:50 +0530 Subject: [PATCH 2/3] Decoder: Initialize first_pb_nal_in_pic for error slices first_pb_nal_in_pic was uninitialized for error clips Bug: 29023649 Change-Id: Ie4e0a94059c5f675bf619e31534846e2c2ca58ae --- decoder/ih264d_api.c | 1 + decoder/ih264d_parse_slice.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c index 8dc9daf..55e3cd4 100644 --- a/decoder/ih264d_api.c +++ b/decoder/ih264d_api.c @@ -2878,6 +2878,7 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) ps_dec->cur_dec_mb_num = 0; ps_dec->cur_recon_mb_num = 0; ps_dec->u4_first_slice_in_pic = 2; + ps_dec->u1_first_pb_nal_in_pic = 1; ps_dec->u1_slice_header_done = 0; ps_dec->u1_dangling_field = 0; diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c index e3e5e3b..910015b 100644 --- a/decoder/ih264d_parse_slice.c +++ b/decoder/ih264d_parse_slice.c @@ -954,7 +954,6 @@ WORD32 ih264d_end_of_pic(dec_struct_t *ps_dec, dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice; WORD32 ret; - ps_dec->u1_first_pb_nal_in_pic = 1; ps_dec->u2_mbx = 0xffff; ps_dec->u2_mby = 0; { From daefcde2ed0e77cda4baa1964aac255ff41a9b1d Mon Sep 17 00:00:00 2001 From: Ray Essick Date: Thu, 23 Jun 2016 14:04:17 -0700 Subject: [PATCH 3/3] DO NOT MERGE ANYWHERE: Remove several memset() calls which overwrote buffers initialized in buf_mgr_init(). Affects 6.0 only. --- decoder/ih264d_utils.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/decoder/ih264d_utils.c b/decoder/ih264d_utils.c index a36cbda..3141370 100644 --- a/decoder/ih264d_utils.c +++ b/decoder/ih264d_utils.c @@ -1062,20 +1062,11 @@ WORD32 ih264d_init_pic(dec_struct_t *ps_dec, size = sizeof(pred_info_t) * 2 * 32; memset(ps_dec->ps_pred, 0 , size); - size = sizeof(disp_mgr_t); - memset(ps_dec->pv_disp_buf_mgr, 0 , size); - - size = sizeof(buf_mgr_t) + ithread_get_mutex_lock_size(); - memset(ps_dec->pv_pic_buf_mgr, 0, size); - size = sizeof(ctxt_inc_mb_info_t); memset(ps_dec->ps_left_mb_ctxt_info, 0, size); size = (sizeof(neighbouradd_t) << 2); memset(ps_dec->ps_left_mvpred_addr, 0 ,size); - - size = sizeof(buf_mgr_t) + ithread_get_mutex_lock_size(); - memset(ps_dec->pv_mv_buf_mgr, 0, size); } /* In shared mode, set all of them as used by display */ if(ps_dec->u4_share_disp_buf == 1)