mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-13 15:40:57 +00:00
SCI: Fix UB shifting negative integers
This commit is contained in:
parent
d874208520
commit
617497d094
@ -89,7 +89,7 @@ uint32 Decompressor::getBitsLSB(int n) {
|
|||||||
// fetching more data to buffer if needed
|
// fetching more data to buffer if needed
|
||||||
if (_nBits < n)
|
if (_nBits < n)
|
||||||
fetchBitsLSB();
|
fetchBitsLSB();
|
||||||
uint32 ret = (_dwBits & ~((~0) << n));
|
uint32 ret = (_dwBits & ~(0xFFFFFFFFU << n));
|
||||||
_dwBits >>= n;
|
_dwBits >>= n;
|
||||||
_nBits -= n;
|
_nBits -= n;
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -113,7 +113,7 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) {
|
|||||||
byte colorMapping[4];
|
byte colorMapping[4];
|
||||||
int16 x, y;
|
int16 x, y;
|
||||||
byte color;
|
byte color;
|
||||||
int16 maskA, maskB;
|
uint16 maskA, maskB;
|
||||||
byte *pOut;
|
byte *pOut;
|
||||||
int16 heightWidth;
|
int16 heightWidth;
|
||||||
|
|
||||||
|
@ -1805,7 +1805,7 @@ int ResourceManager::readResourceMapSCI0(ResourceSource *map) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addResource(resId, source, offset & (((~bMask) << 24) | 0xFFFFFF), 0, map->getLocationName());
|
addResource(resId, source, offset & ((((byte)~bMask) << 24) | 0xFFFFFF), 0, map->getLocationName());
|
||||||
}
|
}
|
||||||
} while (!fileStream->eos());
|
} while (!fileStream->eos());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user