[Scummvm-git-logs] scummvm master -> 67aea068935668e663d91829ed915f2cc5b574c0
sev-
noreply at scummvm.org
Sun May 14 20:41:44 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
67aea06893 IMAGE: Fix MSRLEDecoder if pitch > width
Commit: 67aea068935668e663d91829ed915f2cc5b574c0
https://github.com/scummvm/scummvm/commit/67aea068935668e663d91829ed915f2cc5b574c0
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-05-14T22:41:41+02:00
Commit Message:
IMAGE: Fix MSRLEDecoder if pitch > width
Fixes #14356.
Changed paths:
image/codecs/msrle.cpp
diff --git a/image/codecs/msrle.cpp b/image/codecs/msrle.cpp
index 5c063516236..174f07f7725 100644
--- a/image/codecs/msrle.cpp
+++ b/image/codecs/msrle.cpp
@@ -55,9 +55,10 @@ void MSRLEDecoder::decode8(Common::SeekableReadStream &stream) {
byte *data = (byte *) _surface->getPixels();
uint16 width = _surface->w;
uint16 height = _surface->h;
+ uint16 pitch = _surface->pitch;
- byte *output = data + ((height - 1) * width);
- byte *output_end = data + ((height) * width);
+ byte *output = data + ((height - 1) * pitch);
+ byte *output_end = data + ((height) * pitch) - (pitch - width);
while (!stream.eos()) {
byte count = stream.readByte();
@@ -69,7 +70,7 @@ void MSRLEDecoder::decode8(Common::SeekableReadStream &stream) {
x = 0;
y--;
- output = data + (y * width);
+ output = data + (y * pitch);
} else if (value == 1) {
// End of image
@@ -89,7 +90,7 @@ void MSRLEDecoder::decode8(Common::SeekableReadStream &stream) {
return;
}
- output = data + ((y * width) + x);
+ output = data + ((y * pitch) + x);
} else {
// Copy data
More information about the Scummvm-git-logs
mailing list