Added precautionary tests to background scrolling function in Operation Stealth to avoid possible memory corruptions.

svn-id: r33688
This commit is contained in:
Kari Salminen 2008-08-07 19:46:06 +00:00
parent 853f4dbbe0
commit da84a54694

View File

@ -1041,8 +1041,12 @@ void OSRenderer::drawBackground() {
assert(scroll);
memcpy(_backBuffer, main + mainShift, mainSize);
memcpy(_backBuffer + mainSize, scroll, mainShift);
if (mainSize > 0) { // Just a precaution
memcpy(_backBuffer, main + mainShift, mainSize);
}
if (mainShift > 0) { // Just a precaution
memcpy(_backBuffer + mainSize, scroll, mainShift);
}
}
}