mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 03:10:22 +00:00
DIRECTOR: Fix out-of-bounds write
This commit is contained in:
parent
a85989dd8a
commit
42dc7451ad
@ -204,7 +204,7 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
|
||||
for (x = 0; x < _surface->w;) {
|
||||
switch (_bitsPerPixel) {
|
||||
case 1: {
|
||||
for (int c = 0; c < 8; c++, x++) {
|
||||
for (int c = 0; c < 8 && x < _surface->w; c++, x++) {
|
||||
*((byte *)_surface->getBasePtr(x, y)) = (pixels[(((y * _surface->pitch) + x) / 8)] & (1 << (7 - c))) ? 0 : 0xff;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user