mirror of
https://gitee.com/openharmony/ai_neural_network_runtime
synced 2024-12-04 05:50:44 +00:00
cache number invalid add
Signed-off-by: w30052974 <wangyifan94@huawei.com>
This commit is contained in:
parent
eab4cb80d1
commit
cf1eba8a1d
@ -596,8 +596,8 @@ NNRT_API bool OH_NNModel_HasCache(const char *cacheDir, const char *modelName, u
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fileNumber > FILE_NUMBER_MAX) {
|
||||
LOGE("OH_NNModel_HasCache fileNumber is more than 100");
|
||||
if (fileNumber <= 0 || fileNumber > FILE_NUMBER_MAX) {
|
||||
LOGE("OH_NNModel_HasCache fileNumber is invalid or more than 100");
|
||||
std::filesystem::remove_all(cacheInfoPath);
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user