fix[utils]: adjust format range constraint

Change-Id: I12d57955d6ad84e063784e46893b1deec90785b6
Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
This commit is contained in:
xueman.ruan
2023-09-28 18:02:33 +08:00
committed by Herman Chen
parent 2c6f93d147
commit 22100022d7
4 changed files with 6 additions and 3 deletions

View File

@@ -1561,7 +1561,7 @@ MPP_RET str_to_frm_fmt(const char *nptr, long *number)
else if (errno == 0 && nptr && *endptr != 0)
mpp_err("format: 0x%lx invalid (additional characters remain)", tmp);
else if (errno == 0 && nptr && !*endptr) {
if (tmp < UINT_MAX && tmp >= 0) {
if ((tmp < (MPP_FMT_BUTT | MPP_FRAME_FMT_PROP_MASK)) && tmp >= 0) {
*number = tmp;
ret = MPP_OK;
} else {