Added an out of bound check on u4_num_bufs in input argument am: aa11ab9fdb am: 50ec420228 am: 0514a1ebfb am: fa8bb9d89c am: 96228ba3b9 am: 4a6a743d40 am: 4ed04c7bb1 am: b9027e8cc1 am: 859498bb08

am: 31b397c813

Change-Id: Ieff7174460cc30bb3083c7a7845fe8090bc4bf56
This commit is contained in:
Harish Mahendrakar 2017-09-11 22:41:56 +00:00 committed by android-build-merger
commit 8564f06db6

View file

@ -1804,7 +1804,8 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
&& ps_dec->i4_decode_header == 0) && ps_dec->i4_decode_header == 0)
{ {
UWORD32 i; UWORD32 i;
if(ps_dec->ps_out_buffer->u4_num_bufs == 0) if((ps_dec->ps_out_buffer->u4_num_bufs == 0) ||
(ps_dec->ps_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 |= 1 << IVD_UNSUPPORTEDPARAM;
ps_dec_op->u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUFS; ps_dec_op->u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUFS;