[Scummvm-cvs-logs] scummvm master -> 97966c36e1ef2a00d30410c9d4daae491c1bd994

DrMcCoy drmccoy at drmccoy.de
Tue Mar 29 12:52:59 CEST 2011


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

Summary:
f5fb832b63 GOB: Use memmove instead of memcpy in Surface::blit()
8291732c94 VIDEO: Fix deLZ77() bound check
97966c36e1 VIDEO: Add a workaround for the Inca 2 wisdom gate video


Commit: f5fb832b634f5101dc88f121d9413ef04b5868bf
    https://github.com/scummvm/scummvm/commit/f5fb832b634f5101dc88f121d9413ef04b5868bf
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-03-29T03:32:30-07:00

Commit Message:
GOB: Use memmove instead of memcpy in Surface::blit()

Inca 2 actually blits surfaces on themselves...

Changed paths:
    engines/gob/surface.cpp



diff --git a/engines/gob/surface.cpp b/engines/gob/surface.cpp
index 8d06ca8..c3e8cd9 100644
--- a/engines/gob/surface.cpp
+++ b/engines/gob/surface.cpp
@@ -420,25 +420,25 @@ void Surface::blit(const Surface &from, int16 left, int16 top, int16 right, int1
 		return;
 
 	if ((left == 0) && (_width == from._width) && (_width == width) && (transp == -1)) {
-		// If these conditions are met, we can directly use memcpy
+		// If these conditions are met, we can directly use memmove
 
 		// Pointers to the blit destination and source start points
 		      byte *dst =      getData(x   , y);
 		const byte *src = from.getData(left, top);
 
-		memcpy(dst, src, width * height * _bpp);
+		memmove(dst, src, width * height * _bpp);
 		return;
 	}
 
 	if (transp == -1) {
-		// We don't have to look for transparency => we can use memcpy line-wise
+		// We don't have to look for transparency => we can use memmove line-wise
 
 		// Pointers to the blit destination and source start points
 		      byte *dst =      getData(x   , y);
 		const byte *src = from.getData(left, top);
 
 		while (height-- > 0) {
-			memcpy(dst, src, width * _bpp);
+			memmove(dst, src, width * _bpp);
 
 			dst +=      _width *      _bpp;
 			src += from._width * from._bpp;
@@ -521,7 +521,7 @@ void Surface::blitScaled(const Surface &from, int16 left, int16 top, int16 right
 		posW = 0;
 
 		for (uint16 i = 0; i < width; i++, dstRow += _bpp) {
-			memcpy(dstRow, srcRow, _bpp);
+			memmove(dstRow, srcRow, _bpp);
 
 			posW += step;
 			while (posW >= ((frac_t) FRAC_ONE)) {


Commit: 8291732c946039de5d6e85e6552039fb78616d9c
    https://github.com/scummvm/scummvm/commit/8291732c946039de5d6e85e6552039fb78616d9c
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-03-29T03:39:51-07:00

Commit Message:
VIDEO: Fix deLZ77() bound check

The Inca 2 video where Atahualpa walks through the gate after
solving the wisdom challenge now only warns (and graphically
glitches) instead of segfaulting.

Changed paths:
    video/coktel_decoder.cpp



diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp
index c8beb3b..faf32ea 100644
--- a/video/coktel_decoder.cpp
+++ b/video/coktel_decoder.cpp
@@ -1377,11 +1377,12 @@ bool IMDDecoder::renderFrame(Common::Rect &rect) {
 
 		if ((type == 2) && (rect.width() == _surface.w) && (_x == 0)) {
 			// Directly uncompress onto the video surface
-			int offsetX = rect.left * _surface.bytesPerPixel;
-			int offsetY = (_y + rect.top) * _surface.pitch;
+			const int offsetX = rect.left * _surface.bytesPerPixel;
+			const int offsetY = (_y + rect.top) * _surface.pitch;
+			const int offset  = offsetX + offsetY;
 
-			deLZ77((byte *)_surface.pixels + offsetX + offsetY, dataPtr, dataSize,
-					_surface.w * _surface.h * _surface.bytesPerPixel);
+			deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize,
+					_surface.w * _surface.h * _surface.bytesPerPixel - offset);
 			return true;
 		}
 
@@ -2244,11 +2245,12 @@ bool VMDDecoder::renderFrame(Common::Rect &rect) {
 
 		if ((type == 2) && (rect.width() == _surface.w) && (_x == 0) && (_blitMode == 0)) {
 			// Directly uncompress onto the video surface
-			int offsetX = rect.left * _surface.bytesPerPixel;
-			int offsetY = (_y + rect.top) * _surface.pitch;
+			const int offsetX = rect.left * _surface.bytesPerPixel;
+			const int offsetY = (_y + rect.top) * _surface.pitch;
+			const int offset  = offsetX - offsetY;
 
-			deLZ77((byte *)_surface.pixels + offsetX + offsetY, dataPtr, dataSize,
-					_surface.w * _surface.h * _surface.bytesPerPixel);
+			deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize,
+					_surface.w * _surface.h * _surface.bytesPerPixel - offset);
 			return true;
 		}
 


Commit: 97966c36e1ef2a00d30410c9d4daae491c1bd994
    https://github.com/scummvm/scummvm/commit/97966c36e1ef2a00d30410c9d4daae491c1bd994
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-03-29T03:47:20-07:00

Commit Message:
VIDEO: Add a workaround for the Inca 2 wisdom gate video

When decompressing directly onto the output surface fails (because
it's too small), retry decompressing into the video buffer first,
which then gets blitted onto the output surface.

Changed paths:
    video/coktel_decoder.cpp



diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp
index faf32ea..ef92e5f 100644
--- a/video/coktel_decoder.cpp
+++ b/video/coktel_decoder.cpp
@@ -1381,9 +1381,9 @@ bool IMDDecoder::renderFrame(Common::Rect &rect) {
 			const int offsetY = (_y + rect.top) * _surface.pitch;
 			const int offset  = offsetX + offsetY;
 
-			deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize,
-					_surface.w * _surface.h * _surface.bytesPerPixel - offset);
-			return true;
+			if (deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize,
+			           _surface.w * _surface.h * _surface.bytesPerPixel - offset))
+				return true;
 		}
 
 		_videoBufferLen[1] = deLZ77(_videoBuffer[1], dataPtr, dataSize, _videoBufferSize);
@@ -2249,9 +2249,9 @@ bool VMDDecoder::renderFrame(Common::Rect &rect) {
 			const int offsetY = (_y + rect.top) * _surface.pitch;
 			const int offset  = offsetX - offsetY;
 
-			deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize,
-					_surface.w * _surface.h * _surface.bytesPerPixel - offset);
-			return true;
+			if (deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize,
+			           _surface.w * _surface.h * _surface.bytesPerPixel - offset))
+				return true;
 		}
 
 		srcBuffer = 1;






More information about the Scummvm-git-logs mailing list