!30207 [MS][LITE]sync fuzz

Merge pull request !30207 from mengyuanli/bugfix
This commit is contained in:
i-robot 2022-02-19 02:09:27 +00:00 committed by Gitee
commit 288bbd832a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 5 additions and 0 deletions

View File

@ -205,6 +205,11 @@ class WeightDecoder {
free(dequant_datas);
return nullptr;
}
if (abs(index - INT8_MIN) >= static_cast<int>(param.clusters.size())) {
MS_LOG(ERROR) << "index exceed the boundary of param.clusters";
free(dequant_datas);
return nullptr;
}
dequant_datas[j] = static_cast<DT>(param.clusters[index - INT8_MIN]);
} else {
#ifdef ENABLE_ARM32