From 6e56ee42443150ce9638623cae985a5dbe3757a2 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 16 Dec 2024 21:53:12 -0800 Subject: [PATCH] tools: Only ignore decodeVertexBuffer errors for uncompressed data 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. --- tools/codectest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/codectest.cpp b/tools/codectest.cpp index 50545c250..874de1320 100644 --- a/tools/codectest.cpp +++ b/tools/codectest.cpp @@ -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 output(meshopt_encodeVertexBufferBound(count, stride)); meshopt_encodeVertexVersion(0xe);