StdPNG: Fix crash when saving a screenshot on Linux/Mac 64bit

"unsigned long" is 8 bytes on 64-bit Linux and Mac, so we write 4 bytes
past the end of the allocated memory region.
shapetextures
Armin Burgmeier 2016-01-05 20:19:58 -08:00
parent e0ae612e10
commit 25a19f9922
1 changed files with 1 additions and 1 deletions

View File

@ -225,7 +225,7 @@ bool CPNGFile::SetPix(int iX, int iY, DWORD dwValue)
pPix[2] = GetRedValue(dwValue);
return true;
case PNG_COLOR_TYPE_RGB_ALPHA: // RGBA: simply set in mem
*(unsigned long *) pPix = dwValue;
*(DWORD *) pPix = dwValue;
return true;
}
return false;