From cf91c87b25ad49fc7e307932754d188e3ba2a479 Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Tue, 9 Jun 2015 17:48:53 +0530 Subject: Fixed an overread in YUV420 Semi-planar input usecase Handled non-multiple of 16 dimensions for 420 semiplanar input Modified test code to remove alignment of width and height Bug: 21586373 Change-Id: I83ff8165364a863d577fcac81e711b07eec9c004 --- test/encoder/main.c | 2 +- test/encoder/recon.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/encoder/main.c b/test/encoder/main.c index bb9cabf..26420e2 100644 --- a/test/encoder/main.c +++ b/test/encoder/main.c @@ -1591,7 +1591,7 @@ void synchronous_encode(iv_obj_t *ps_enc, app_ctxt_t *ps_app_ctxt) ps_inp_raw_buf->apv_bufs[0] = pu1_buf; /*Init chroma buffer*/ - pu1_buf += (ps_app_ctxt->u4_strd) * ALIGN16(ps_app_ctxt->u4_ht); + pu1_buf += ps_app_ctxt->u4_strd * ps_app_ctxt->u4_ht; ps_inp_raw_buf->apv_bufs[1] = pu1_buf; ps_inp_raw_buf->au4_wd[0] = ps_app_ctxt->u4_wd; diff --git a/test/encoder/recon.c b/test/encoder/recon.c index 7fd0f5c..ed63aac 100644 --- a/test/encoder/recon.c +++ b/test/encoder/recon.c @@ -97,7 +97,7 @@ void allocate_recon(app_ctxt_t *ps_app_ctxt) num_bufs = DEFAULT_NUM_RECON_BUFS; /* Size of buffer for YUV420/420SP */ - luma_size = ALIGN16(ps_app_ctxt->u4_max_wd) * ALIGN16(ps_app_ctxt->u4_max_ht); + luma_size = ps_app_ctxt->u4_max_wd * ps_app_ctxt->u4_max_ht; chroma_size = (luma_size) / 4; pic_size = luma_size + chroma_size * 2; -- cgit v1.2.3