diff --git a/GPU/D3D11/DrawEngineD3D11.cpp b/GPU/D3D11/DrawEngineD3D11.cpp index 15f2d18bdf..6a0bcdb06e 100644 --- a/GPU/D3D11/DrawEngineD3D11.cpp +++ b/GPU/D3D11/DrawEngineD3D11.cpp @@ -444,9 +444,10 @@ inline u32 ComputeMiniHashRange(const void *ptr, size_t sz) { if (sz > 100) { size_t step = sz / 4; + size_t len = std::min((int)step, 100); u32 hash = 0; for (size_t i = 0; i < sz; i += step) { - hash += DoReliableHash32(p + i, 100, 0x3A44B9C4); + hash += DoReliableHash32(p + i, len, 0x3A44B9C4); } return hash; } else { diff --git a/GPU/Directx9/DrawEngineDX9.cpp b/GPU/Directx9/DrawEngineDX9.cpp index 5c1510c60b..55f2cf9fd7 100644 --- a/GPU/Directx9/DrawEngineDX9.cpp +++ b/GPU/Directx9/DrawEngineDX9.cpp @@ -428,9 +428,10 @@ inline u32 ComputeMiniHashRange(const void *ptr, size_t sz) { if (sz > 100) { size_t step = sz / 4; + size_t len = std::min((int)step, 100); u32 hash = 0; for (size_t i = 0; i < sz; i += step) { - hash += DoReliableHash32(p + i, 100, 0x3A44B9C4); + hash += DoReliableHash32(p + i, len, 0x3A44B9C4); } return hash; } else { diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index 4034684bc7..0eae334cc7 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -445,8 +445,9 @@ inline u32 ComputeMiniHashRange(const void *ptr, size_t sz) { if (sz > 100) { size_t step = sz / 4; u32 hash = 0; + size_t len = std::min((int)step, 100); for (size_t i = 0; i < sz; i += step) { - hash += DoReliableHash32(p + i, 100, 0x3A44B9C4); + hash += DoReliableHash32(p + i, len, 0x3A44B9C4); } return hash; } else {