[Scummvm-cvs-logs] SF.net SVN: scummvm:[45207] scummvm/trunk/engines/kyra/screen.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Oct 18 00:47:21 CEST 2009


Revision: 45207
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45207&view=rev
Author:   lordhoto
Date:     2009-10-17 22:47:21 +0000 (Sat, 17 Oct 2009)

Log Message:
-----------
Fix valgrind warning.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/screen.cpp

Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp	2009-10-17 22:00:33 UTC (rev 45206)
+++ scummvm/trunk/engines/kyra/screen.cpp	2009-10-17 22:47:21 UTC (rev 45207)
@@ -3438,13 +3438,10 @@
 	assert(firstCol >= 0 && firstCol <= source.getNumColors());
 	assert(dstStart >= 0 && dstStart + numCols <= _numColors);
 
-	memcpy(_palData + dstStart * 3, source._palData + firstCol * 3, numCols * 3);
+	memmove(_palData + dstStart * 3, source._palData + firstCol * 3, numCols * 3);
 }
 
 void Palette::copy(const uint8 *source, int firstCol, int numCols, int dstStart) {
-	if (source == _palData)
-		return;
-
 	if (dstStart == -1)
 		dstStart = firstCol;
 
@@ -3452,7 +3449,7 @@
 	assert(firstCol >= 0);
 	assert(dstStart >= 0 && dstStart + numCols <= _numColors);
 
-	memcpy(_palData + dstStart * 3, source + firstCol * 3, numCols * 3);
+	memmove(_palData + dstStart * 3, source + firstCol * 3, numCols * 3);
 }
 
 uint8 *Palette::fetchRealPalette() const {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list