matdbg: fix two memory bugs (#8337)

- murmur3 expects word size not byte size
 - should use uint8_t in addressing blob source.

both would crash when asan is enabled.
This commit is contained in:
Powei Feng
2025-01-06 10:33:25 -08:00
committed by GitHub
parent 8c1e028b46
commit 7d0b652663
2 changed files with 2 additions and 2 deletions

View File

@@ -198,7 +198,7 @@ DebugServer::addMaterial(const CString& name, const void* data, size_t size, voi
// material data.
constexpr uint32_t seed = 42;
uint64_t dataSpace[2] = {(uint64_t) data, (uint64_t) userdata};
uint32_t const key = utils::hash::murmur3((const uint32_t*) dataSpace, sizeof(dataSpace), seed);
uint32_t const key = utils::hash::murmurSlow((uint8_t const*) dataSpace, sizeof(dataSpace), seed);
// Retain a copy of the package to permit queries after the client application has
// freed up the original material package.