diff --git a/DirectXTex/d3dx12.h b/DirectXTex/d3dx12.h index 45f6b4e..8016989 100644 --- a/DirectXTex/d3dx12.h +++ b/DirectXTex/d3dx12.h @@ -1868,12 +1868,12 @@ inline void MemcpySubresource( { for (UINT z = 0; z < NumSlices; ++z) { - BYTE* pDestSlice = reinterpret_cast(pDest->pData) + pDest->SlicePitch * z; - const BYTE* pSrcSlice = reinterpret_cast(pSrc->pData) + pSrc->SlicePitch * z; + auto pDestSlice = reinterpret_cast(pDest->pData) + pDest->SlicePitch * z; + auto pSrcSlice = reinterpret_cast(pSrc->pData) + pSrc->SlicePitch * LONG_PTR(z); for (UINT y = 0; y < NumRows; ++y) { memcpy(pDestSlice + pDest->RowPitch * y, - pSrcSlice + pSrc->RowPitch * y, + pSrcSlice + pSrc->RowPitch * LONG_PTR(y), RowSizeInBytes); } }