diff options
author | Chris Apers | 2006-09-09 13:57:20 +0000 |
---|---|---|
committer | Chris Apers | 2006-09-09 13:57:20 +0000 |
commit | f34da528ebe095fe84e0f58424cf4ae941a6d4e5 (patch) | |
tree | bfadc8aaa9926e911e7c4637a192f24ac55ffa7a /engines/sword1 | |
parent | 7bb8ca3ef69a1d0fe2c1d15b39e9d100186a7b73 (diff) | |
download | scummvm-rg350-f34da528ebe095fe84e0f58424cf4ae941a6d4e5.tar.gz scummvm-rg350-f34da528ebe095fe84e0f58424cf4ae941a6d4e5.tar.bz2 scummvm-rg350-f34da528ebe095fe84e0f58424cf4ae941a6d4e5.zip |
Fixed unaligned read (this fix a potential crash clicking on the Text option button)
svn-id: r23845
Diffstat (limited to 'engines/sword1')
-rw-r--r-- | engines/sword1/control.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index 47a1822012..38cc2f4554 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -140,12 +140,12 @@ void ControlButton::draw(void) { FrameHeader *fHead = _resMan->fetchFrame(_resMan->fetchRes(_resId), _frameIdx); uint8 *src = (uint8*)fHead + sizeof(FrameHeader); uint8 *dst = _dstBuf; - for (uint16 cnt = 0; cnt < FROM_LE_16(fHead->height); cnt++) { - for (uint16 cntx = 0; cntx < FROM_LE_16(fHead->width); cntx++) + for (uint16 cnt = 0; cnt < READ_LE_UINT16(&fHead->height); cnt++) { + for (uint16 cntx = 0; cntx < READ_LE_UINT16(&fHead->width); cntx++) if (src[cntx]) dst[cntx] = src[cntx]; dst += SCREEN_WIDTH; - src += FROM_LE_16(fHead->width); + src += READ_LE_UINT16(&fHead->width); } _system->copyRectToScreen(_dstBuf, SCREEN_WIDTH, _x, _y, _width, _height); } |