summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2016-04-21 09:04:37 +0530
committerJessica Wagantall <jwagantall@cyngn.com>2016-07-07 11:07:25 -0700
commitc22fbda295b3f115a75de06a45a2308b0cf96111 (patch)
treede9d16c80adc33bcd89266030fd6df62cb3a08e9
parentce128de39e172d5eb920d8b6137d011bcba97499 (diff)
downloadandroid_external_libavc-c22fbda295b3f115a75de06a45a2308b0cf96111.tar.gz
android_external_libavc-c22fbda295b3f115a75de06a45a2308b0cf96111.tar.bz2
android_external_libavc-c22fbda295b3f115a75de06a45a2308b0cf96111.zip
Decoder: Memset few structures to zero to handle error clips
Bug: 27907656 Ticket: CYNGNOS-3020 Change-Id: I671d135dd5c324c39b4ede990b7225d52ba882cd (cherry picked from commit 370bd8625d9167dc05a07bf4d02ab931d940e23a)
-rw-r--r--decoder/ih264d_api.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index c264d9a..b6d4e35 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -889,6 +889,43 @@ void ih264d_init_decoder(void * ps_dec_params)
dec_struct_t * ps_dec = (dec_struct_t *)ps_dec_params;
dec_slice_params_t *ps_cur_slice;
pocstruct_t *ps_prev_poc, *ps_cur_poc;
+ WORD32 size;
+
+ 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(dec_err_status_t);
+ memset(ps_dec->ps_dec_err_status, 0, size);
+
+ size = sizeof(sei);
+ memset(ps_dec->ps_sei, 0, size);
+
+ size = sizeof(dpb_commands_t);
+ memset(ps_dec->ps_dpb_cmds, 0, size);
+
+ size = sizeof(dec_bit_stream_t);
+ memset(ps_dec->ps_bitstrm, 0, size);
+
+ size = sizeof(dec_slice_params_t);
+ memset(ps_dec->ps_cur_slice, 0, size);
+
+ size = MAX(sizeof(dec_seq_params_t), sizeof(dec_pic_params_t));
+ memset(ps_dec->pv_scratch_sps_pps, 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);
/* Free any dynamic buffers that are allocated */
ih264d_free_dynamic_bufs(ps_dec);