Aligned ps_pic_pu to 4 bytes

stmia was resulting in SEGV_MAPERR when ps_pic_pu is not aligned to 4 bytes
Bugfix: 24686670, 21468583

Change-Id: I07672d4a790f73cf27964983350181e66edc4d57
This commit is contained in:
Harish Mahendrakar 2015-10-09 19:19:06 +05:30 • committed by Marco Nelissen
parent 2b67e53265
commit e8bfec1fa4
2 changed files with 4 additions and 1 deletions

View file

@ -49,6 +49,7 @@
#define ALIGN32(x) ((((x) + 31) >> 5) << 5)
#define ALIGN16(x) ((((x) + 15) >> 4) << 4)
#define ALIGN8(x) ((((x) + 7) >> 3) << 3)
#define ALIGN4(x) ((((x) + 3) >> 2) << 2)
#define ALIGN_POW2(ptr,align) ((((WORD32)ptr)+align-1)&(~(align-1)))

View file

@ -354,6 +354,8 @@ WORD32 ihevcd_get_pic_mv_bank_size(WORD32 num_luma_samples)
/* Size for storing pu_t for each PU */
mv_bank_size += num_pu * sizeof(pu_t);
/* Size for storing slice_idx for each CTB */
mv_bank_size += ALIGN4(num_ctb * sizeof(UWORD16));
size = mv_bank_size;
return size;
@ -720,7 +722,7 @@ IHEVCD_ERROR_T ihevcd_mv_buf_mgr_add_bufs(codec_t *ps_codec)
pu1_buf += num_pu;
ps_mv_buf->pu1_pic_slice_map = (UWORD16 *)pu1_buf;
pu1_buf += num_ctb * sizeof(UWORD16);
pu1_buf += ALIGN4(num_ctb * sizeof(UWORD16));
ps_mv_buf->ps_pic_pu = (pu_t *)pu1_buf;