aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/composer/composer.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index 639b077ed7..accbe7dda5 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -1389,8 +1389,10 @@ static void decompressSLWM(byte *buffer, Common::SeekableReadStream *stream) {
count += 2;
start++;
- memcpy(buffer, buffer - start, count);
- buffer += count;
+ for (uint i = 0; i < count; i++) {
+ *buffer = *(buffer - start);
+ buffer++;
+ }
}
}
@@ -1441,8 +1443,11 @@ void ComposerEngine::decompressBitmap(uint16 type, Common::SeekableReadStream *s
size -= 2;
}
count += 4;
- memcpy(buffer, buffer - step - 1, count);
- buffer += count;
+ // this is often overlapping (for repeating patterns)
+ for (uint i = 0; i < count; i++) {
+ *buffer = *(buffer - step - 1);
+ buffer++;
+ }
}
break;
case kBitmapRLESLWM: