Decoder: Reset p_curr_ctxt->i1_ref_idx using memset

Since p_curr_ctxt->i1_ref_idx is not guaranteed to be 4 byte aligned,
use memset instead of using it as an int pointer.
On platforms that do not support unaligned stores, this change is needed

Bug: 33073518
Test: Tested with -fsanitize=alignment enabled on avcdec

Change-Id: I5970454be3250f6f87eab383f3b6afbf5b56f201
This commit is contained in:
Harish Mahendrakar 2016-11-22 12:24:59 +05:30
parent e98bd1f5a0
commit ef2f525bec

View file

@ -509,9 +509,7 @@ WORD32 ih264d_parse_imb_cabac(dec_struct_t * ps_dec,
MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
*((UWORD32 *)ps_dec->pi1_left_ref_idx_ctxt_inc) = 0;
MEMSET_16BYTES(p_curr_ctxt->u1_mv, 0);
pi1_buf = p_curr_ctxt->i1_ref_idx;
pi4_buf = (WORD32 *)pi1_buf;
*pi4_buf = 0;
memset(p_curr_ctxt->i1_ref_idx, 0, 4);
}
if(u1_mb_type == I_4x4_MB)