[Scummvm-cvs-logs] SF.net SVN: scummvm:[45558] scummvm/trunk/backends/platform/sdl/graphics. cpp
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Sat Oct 31 13:38:08 CET 2009
Revision: 45558
http://scummvm.svn.sourceforge.net/scummvm/?rev=45558&view=rev
Author: eriktorbjorn
Date: 2009-10-31 12:38:08 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
Fixed Valgrind warning caused by always reading four bytes at a time from the
cursor source buffer.
Modified Paths:
--------------
scummvm/trunk/backends/platform/sdl/graphics.cpp
Modified: scummvm/trunk/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/graphics.cpp 2009-10-31 12:19:35 UTC (rev 45557)
+++ scummvm/trunk/backends/platform/sdl/graphics.cpp 2009-10-31 12:38:08 UTC (rev 45558)
@@ -1543,7 +1543,6 @@
const byte *srcPtr = _mouseData;
#ifdef USE_RGB_COLOR
uint32 color;
- uint32 colormask = (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
#else
byte color;
#endif
@@ -1582,10 +1581,13 @@
for (j = 0; j < w; j++) {
#ifdef USE_RGB_COLOR
if (_cursorFormat.bytesPerPixel > 1) {
- color = (*(uint32 *) srcPtr) & colormask;
+ if (_cursorFormat.bytesPerPixel == 2)
+ color = *(uint16 *)srcPtr;
+ else
+ color = *(uint32 *)srcPtr;
if (color != _mouseKeyColor) { // transparent, don't draw
- uint8 r,g,b;
- _cursorFormat.colorToRGB(color,r,g,b);
+ uint8 r, g, b;
+ _cursorFormat.colorToRGB(color, r, g, b);
*(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
r, g, b);
}
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