aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/cursorman.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index fe90545280..8f31421a8b 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -206,7 +206,7 @@ void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint nu
}
Palette *pal = _cursorPaletteStack.top();
- uint size = 4 * num;
+ uint size = 3 * num;
if (pal->_size < size) {
// Could not re-use the old buffer. Create a new one.
@@ -219,7 +219,7 @@ void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint nu
pal->_num = num;
if (num) {
- memcpy(pal->_data, colors, 4 * num);
+ memcpy(pal->_data, colors, size);
g_system->setCursorPalette(pal->_data, pal->_start, pal->_num);
} else {
g_system->disableCursorPalette(true);
@@ -256,7 +256,7 @@ CursorManager::Cursor::~Cursor() {
CursorManager::Palette::Palette(const byte *colors, uint start, uint num) {
_start = start;
_num = num;
- _size = 4 * num;
+ _size = 3 * num;
if (num) {
_data = new byte[_size];