capi异常值检测

Signed-off-by: gxjhl <fangyuhao1@huawei.com>
Change-Id: I50e11ab023c50ba1053b25db64bfd1fb4f5ae1bb
This commit is contained in:
gxjhl 2024-08-09 17:39:23 +08:00
parent d453912cb1
commit 5c26f6f3c5

View File

@ -77,6 +77,9 @@ void OH_ArkUI_WaterFlowSectionOption_SetCrossCount(
if (index < 0) {
return;
}
if (crossCount <= 0) {
crossCount = 1;
}
auto size = static_cast<int32_t>(option->sections.size());
if (size == 0 || size <= index + 1) {
option->sections.resize(static_cast<uint32_t>(index + 1));