Fixed decoding of large meshes encoded with MESH_SEQUENTIAL_ENCODING

num_points was retrieved from a wrong location causing incorrect branch to be taken during decoding for certain input models.
This commit is contained in:
Ondrej Stava 2022-01-25 19:19:17 -08:00 committed by GitHub
parent df3d799cd7
commit aff3972754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,7 +96,7 @@ bool MeshSequentialDecoder::DecodeConnectivity() {
}
mesh()->AddFace(face);
}
} else if (mesh()->num_points() < (1 << 21) &&
} else if (num_points < (1 << 21) &&
bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
// Decode indices as uint32_t.
for (uint32_t i = 0; i < num_faces; ++i) {