aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2017-10-18 20:25:50 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-10-18 20:25:50 +0000
commit65c6d5d5fdc42d40b181f971ec23f776cb35b994 (patch)
tree1e0b667798e636b3f2e14ade827da64357b63f7a
parentd3bffce5131087df37fb0d14418f99ca13a6c998 (diff)
parentdff6ca55d9154d5c159e12c11554176249ffb3d2 (diff)
downloadlibhevc-65c6d5d5fdc42d40b181f971ec23f776cb35b994.tar.gz
Merge "Added an out of bound check on u4_num_bufs in input argument" into lmp-dev am: 4b5c23e393 am: b49adbf304 am: 4ff7f4bfee am: 556af11a03 am: 7fa961814d am: 731ca5667e am: 28ca35d693 am: e7af63d071 am: c49fabf29a
am: dff6ca55d9 Change-Id: I656a410970f0084084a0e4c5101b476474d02fd6
-rw-r--r--decoder/ihevcd_decode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/decoder/ihevcd_decode.c b/decoder/ihevcd_decode.c
index 7b82e84..04ad8f5 100644
--- a/decoder/ihevcd_decode.c
+++ b/decoder/ihevcd_decode.c
@@ -421,7 +421,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;