forked from Mirrors/openclonk
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
parent
e0ae612e10
commit
25a19f9922
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue