Fix crash on uvunwrapping #18

master
Jeremy Hu 2018-12-01 23:21:53 +09:30
parent 90b0388ff0
commit f0334c3eec
2 changed files with 6 additions and 2 deletions

View File

@ -4,10 +4,10 @@ DEFINES += NDEBUG
RESOURCES += resources.qrc RESOURCES += resources.qrc
isEmpty(HUMAN_VERSION) { isEmpty(HUMAN_VERSION) {
HUMAN_VERSION = "1.0.0-beta.3" HUMAN_VERSION = "1.0.0-beta.4"
} }
isEmpty(VERSION) { isEmpty(VERSION) {
VERSION = 1.0.0.3 VERSION = 1.0.0.4
} }
REPOSITORY_URL = "https://github.com/huxingyi/dust3d" REPOSITORY_URL = "https://github.com/huxingyi/dust3d"

View File

@ -55,6 +55,10 @@ bool extractResult(const std::vector<Vertex> &verticies, const Eigen::MatrixXd &
return false; return false;
return true; return true;
}; };
if ((decltype(verticies.size()))V_uv.size() < verticies.size() * 2) {
qDebug() << "Invalid V_uv.size:" << V_uv.size() << "Expected:" << verticies.size() * 2;
return false;
}
for (decltype(verticies.size()) i = 0; i < verticies.size(); i++) { for (decltype(verticies.size()) i = 0; i < verticies.size(); i++) {
TextureCoord coord; TextureCoord coord;
coord.uv[0] = V_uv.row(i)[0]; coord.uv[0] = V_uv.row(i)[0];