aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-09-21 23:25:03 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-09-21 23:25:03 +0000
commit52d2372ed044ef21c9828ea63f741b269a47188d (patch)
tree63d63881d8f7351d0d3907226a4fd26c1b9ee569
parent034d622979de55889183936af8bc23e8c83ffc46 (diff)
parent9b546d6f830794f99c3d91631f8547d27e6d4cf5 (diff)
downloadlibhevc-oreo-release.tar.gz
Merge cherrypicks of [2940345, 2938007, 2940429, 2939599, 2939600, 2940430, 2940431, 2940432, 2940433, 2939601, 2939602, 2940112, 2940113, 2940114, 2940115, 2940116, 2938720, 2938721, 2938722, 2938723, 2938724, 2939603, 2939604, 2939605, 2939608, 2938725, 2938008, 2940438, 2940439, 2938727, 2940549, 2940551, 2940553, 2938335, 2940555, 2940557, 2940440] into oc-releaseandroid-8.0.0_r28oreo-release
Change-Id: Ia850bd4f5c74045da6a359a933f627626c0bb5b6
-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;