diff --git a/DirectXTex/d3dx12.h b/DirectXTex/d3dx12.h index ed0eec4..3bf9ac5 100644 --- a/DirectXTex/d3dx12.h +++ b/DirectXTex/d3dx12.h @@ -2024,11 +2024,11 @@ inline void MemcpySubresource( for (UINT z = 0; z < NumSlices; ++z) { auto pDestSlice = static_cast(pDest->pData) + pDest->SlicePitch * z; - auto pSrcSlice = (static_cast(pResourceData) + pSrc->Offset) + pSrc->DepthPitch * LONG_PTR(z); + auto pSrcSlice = (static_cast(pResourceData) + pSrc->Offset) + pSrc->DepthPitch * ULONG_PTR(z); for (UINT y = 0; y < NumRows; ++y) { memcpy(pDestSlice + pDest->RowPitch * y, - pSrcSlice + pSrc->RowPitch * LONG_PTR(y), + pSrcSlice + pSrc->RowPitch * ULONG_PTR(y), RowSizeInBytes); } }