提交 7c0bc5e8 编写于 作者: L liuxu

perception:io_util add range check

上级 2c1316df
......@@ -108,7 +108,10 @@ bool load_frame_objects(const std::string& filename,
int frame_id = -1;
int object_number = -1;
fin >> frame_id >> object_number;
if (object_number < 0 || object_number > 10000) {
fin.close();
return false;
}
objects_out->clear();
for (int i = 0; i < object_number; ++i) {
......@@ -179,6 +182,7 @@ bool load_frame_objects(const std::string& filename,
point_number != indice_number) {
std::cerr << "illegal object with different points & indices" << filename
<< " object " << i << std::endl;
fin.close();
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册