[Scummvm-cvs-logs] scummvm master -> 018828ba90bd60c457ad8d5e699226646aaeed42

m-kiewitz m_kiewitz at users.sourceforge.net
Sun May 22 22:50:39 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
018828ba90 AGI: Fix invalid read (/crash), when shaking screen


Commit: 018828ba90bd60c457ad8d5e699226646aaeed42
    https://github.com/scummvm/scummvm/commit/018828ba90bd60c457ad8d5e699226646aaeed42
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-05-22T22:52:11+02:00

Commit Message:
AGI: Fix invalid read (/crash), when shaking screen

Was a regression caused by commit
e1c36a52b561463217e22687605d2f4f1dc33be6
(upscaling + hercules font support)
Thanks to salty-horse for reporting this issue

Changed paths:
    engines/agi/graphics.cpp



diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 6d3563a..c7d643d 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -1178,13 +1178,17 @@ void GfxMgr::drawCharacterOnDisplay(int16 x, int16 y, const byte character, byte
 #define SHAKE_HORIZONTAL_PIXELS 4
 
 // Sierra used some EGA port trickery to do it, we have to do it by copying pixels around
+//
+// Shaking locations:
+// - Fanmade "Enclosure" right during the intro
+// - Space Quest 2 almost right at the start when getting captured (after walking into the space ship)
 void GfxMgr::shakeScreen(int16 repeatCount) {
 	int shakeNr, shakeCount;
 	uint8 *blackSpace;
 	int16 shakeHorizontalPixels = SHAKE_HORIZONTAL_PIXELS * (2 + _displayWidthMulAdjust);
 	int16 shakeVerticalPixels = SHAKE_VERTICAL_PIXELS * (1 + _displayHeightMulAdjust);
 
-	if ((blackSpace = (uint8 *)calloc(shakeVerticalPixels * _displayScreenWidth, 1)) == NULL)
+	if ((blackSpace = (uint8 *)calloc(shakeHorizontalPixels * _displayScreenWidth, 1)) == NULL)
 		return;
 
 	shakeCount = repeatCount * 8; // effectively 4 shakes per repeat






More information about the Scummvm-git-logs mailing list