mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-29 03:32:28 +08:00
[hal_bufs]: Add more parameter check
Change-Id: I0a1296e92b33fbae1f7c605cd85f933b2359f3c9 Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -158,13 +158,13 @@ MPP_RET hal_bufs_setup(HalBufs bufs, RK_S32 max_cnt, RK_S32 size_cnt, size_t siz
|
|||||||
RK_S32 elem_size = 0;
|
RK_S32 elem_size = 0;
|
||||||
RK_S32 impl_size = 0;
|
RK_S32 impl_size = 0;
|
||||||
|
|
||||||
if (NULL == bufs) {
|
if (NULL == bufs || NULL == sizes) {
|
||||||
mpp_err_f("invalid NULL input\n");
|
mpp_err_f("invalid NULL input bufs %p sizes %p\n", bufs, sizes);
|
||||||
return MPP_ERR_NULL_PTR;
|
return MPP_ERR_NULL_PTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max_cnt < 0 || max_cnt > MAX_HAL_BUFS_CNT ||
|
if (max_cnt <= 0 || max_cnt > MAX_HAL_BUFS_CNT ||
|
||||||
size_cnt < 0 || size_cnt > MAX_HAL_BUFS_SIZE_CNT) {
|
size_cnt <= 0 || size_cnt > MAX_HAL_BUFS_SIZE_CNT) {
|
||||||
mpp_err_f("invalid max cnt %d size cnt %d\n", max_cnt, size_cnt);
|
mpp_err_f("invalid max cnt %d size cnt %d\n", max_cnt, size_cnt);
|
||||||
return MPP_ERR_VALUE;
|
return MPP_ERR_VALUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user