aboutsummaryrefslogtreecommitdiff
path: root/guilib/TextureDX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'guilib/TextureDX.cpp')
-rw-r--r--guilib/TextureDX.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/guilib/TextureDX.cpp b/guilib/TextureDX.cpp
index c55d81f894..baa733c787 100644
--- a/guilib/TextureDX.cpp
+++ b/guilib/TextureDX.cpp
@@ -97,6 +97,7 @@ void CDXTexture::LoadToGPU()
unsigned char *src = m_pixels;
unsigned int dstPitch = lr.Pitch;
unsigned int srcPitch = GetPitch();
+ unsigned int minPitch = std::min(srcPitch, dstPitch);
unsigned int rows = GetRows();
if (srcPitch == dstPitch)
@@ -107,7 +108,7 @@ void CDXTexture::LoadToGPU()
{
for (unsigned int y = 0; y < rows; y++)
{
- memcpy(dst, src, std::min(srcPitch, dstPitch));
+ memcpy(dst, src, minPitch);
src += srcPitch;
dst += dstPitch;
}