aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-09-21 23:33:48 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-09-21 23:33:48 +0000
commita114a7ef59fb04d5afa01514cb1bbb448016ae73 (patch)
tree83dc93f1e86e501478b82ca4670fd01998fe2c16
parent570854c89cc50d651b24089003e6e172e8ac367a (diff)
parentf2137d88de16bdf586f248dd6552653dcd2ee4e5 (diff)
downloadlibhevc-oreo-dr1-release.tar.gz
Merge cherrypicks of [2937968, 2940489, 2939606, 2939607, 2940434, 2940435, 2940436, 2940437, 2940509, 2940510, 2940118, 2940119, 2940120, 2940121, 2940122, 2938726, 2938728, 2940550, 2940552, 2940554, 2940556, 2940511, 2940512, 2940513, 2940514, 2940515, 2940558, 2940649, 2940650, 2940441, 2940442, 2940559, 2940560, 2940561, 2940562, 2940563, 2940564, 2938336, 2940565, 2940566, 2940516, 2940443, 2940517, 2940444, 2940445] into oc-dr1-releaseandroid-8.0.0_r33android-8.0.0_r25oreo-dr1-release
Change-Id: Ie7f4ea991a99c26496018093ef54de0d3242a46c
-rw-r--r--decoder/ihevcd_api.c6
-rw-r--r--decoder/ihevcd_decode.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/decoder/ihevcd_api.c b/decoder/ihevcd_api.c
index c349fcb..5289a12 100644
--- a/decoder/ihevcd_api.c
+++ b/decoder/ihevcd_api.c
@@ -1871,10 +1871,10 @@ WORD32 ihevcd_allocate_dynamic_bufs(codec_t *ps_codec)
}
/* Max CTBs in a row */
- size = wd / MIN_CTB_SIZE + 2 /* Top row and bottom row extra. This ensures accessing left,top in first row
- and right in last row will not result in invalid access*/;
+ size = wd / MIN_CTB_SIZE;
/* Max CTBs in a column */
- size *= ht / MIN_CTB_SIZE;
+ size *= (ht / MIN_CTB_SIZE + 2) /* Top row and bottom row extra. This ensures accessing left,top in first row
+ and right in last row will not result in invalid access*/;
size *= sizeof(UWORD16);
pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
diff --git a/decoder/ihevcd_decode.c b/decoder/ihevcd_decode.c
index dfb5042..6f38e90 100644
--- a/decoder/ihevcd_decode.c
+++ b/decoder/ihevcd_decode.c
@@ -456,7 +456,8 @@ WORD32 ihevcd_decode(iv_obj_t *ps_codec_obj, void *pv_api_ip, void *pv_api_op)
if(0 == ps_codec->i4_share_disp_buf && ps_codec->i4_header_mode == 0)
{
UWORD32 i;
- if(ps_dec_ip->s_out_buffer.u4_num_bufs == 0)
+ if((ps_dec_ip->s_out_buffer.u4_num_bufs <= 0) ||
+ (ps_dec_ip->s_out_buffer.u4_num_bufs > IVD_VIDDEC_MAX_IO_BUFFERS))
{
ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
ps_dec_op->u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUFS;