diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2017-10-04 18:11:41 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-10-04 18:11:41 +0000 |
| commit | b50dfe64068c1250c6a0ef07154ab3c86a54a5f1 (patch) | |
| tree | 63d63881d8f7351d0d3907226a4fd26c1b9ee569 | |
| parent | b837b72389e98d59a3fa2feceb57da312886d58f (diff) | |
| parent | a35ef9336b36f6f89ac47e056b57961a1cc1ec5a (diff) | |
| download | platform_external_libhevc-oreo-r2-release.tar.gz platform_external_libhevc-oreo-r2-release.tar.bz2 platform_external_libhevc-oreo-r2-release.zip | |
Merge cherrypicks of [3012829, 3012750, 3012751, 3012600, 3012601, 3012602, 3012603, 3012849, 3012850, 3012869, 3012870, 3012871, 3012872, 3012873, 3012630, 3012631, 3012632, 3012633, 3012634, 3012752, 3012753, 3012604, 3012605, 3012606, 3012929] into oc-r2-releaseandroid-8.0.0_r29oreo-r2-release
Change-Id: I0fe3e6943a285f9090c25260295b46e8b077a9ad
| -rw-r--r-- | decoder/ihevcd_api.c | 6 | ||||
| -rw-r--r-- | decoder/ihevcd_decode.c | 3 |
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; |
