From 0acf9dcb1b880da77f94819a91494e8c671f84cc Mon Sep 17 00:00:00 2001 From: Nick Wu Date: Thu, 11 May 2023 13:08:59 -0700 Subject: [PATCH] used correct integer compression to get decompression working space size --- pxr/usd/usd/integerCoding.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pxr/usd/usd/integerCoding.cpp b/pxr/usd/usd/integerCoding.cpp index 8aa481c851..adbc6f5480 100644 --- a/pxr/usd/usd/integerCoding.cpp +++ b/pxr/usd/usd/integerCoding.cpp @@ -389,9 +389,14 @@ template size_t _DecompressIntegers(char const *compressed, size_t compressedSize, Int *ints, size_t numInts, char *workingSpace) { + using Compressor = typename std::conditional< + sizeof(Int) == 4, + Usd_IntegerCompression, + Usd_IntegerCompression64>::type; + // Working space. size_t workingSpaceSize = - Usd_IntegerCompression::GetDecompressionWorkingSpaceSize(numInts); + Compressor::GetDecompressionWorkingSpaceSize(numInts); std::unique_ptr tmpSpace; if (!workingSpace) { tmpSpace.reset(new char[workingSpaceSize]);