Skip to content

Commit

Permalink
tools: Only ignore decodeVertexBuffer errors for uncompressed data
Browse files Browse the repository at this point in the history
We were previously only ignoring the error if the input file matched the
expected decompressed size exactly; this could lead to silently wrong
results in certain cases when the data is just invalid.
  • Loading branch information
zeux committed Dec 17, 2024
1 parent 20b26f9 commit 6e56ee4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/codectest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ void testFile(FILE* file, size_t count, size_t stride, Stats* stats = 0)
input.resize(meshopt_encodeVertexBufferBound(count, stride));
input.resize(meshopt_encodeVertexBuffer(input.data(), input.size(), decoded.data(), count, stride));
}
else if (res != 0)
{
printf(" error decoding input: %d", res);
return;
}

std::vector<unsigned char> output(meshopt_encodeVertexBufferBound(count, stride));
meshopt_encodeVertexVersion(0xe);
Expand Down

0 comments on commit 6e56ee4

Please sign in to comment.