-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
IMAGE: Fix MSRLEDecoder if pitch > width #4832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Your fix seems incomplete. |
|
@lephilousophe can you be more specific? I don't understand the code that much but |
|
I must say that I don't know RLE and that this cross line coding may be forbidden by the specification. |
|
Ah, right, now I see what you mean. Judging from the I'd argue that if this assumption turns out to be false, I'd be the first to notice as it seems that Btw do you know how to quickly test the 4-bit variant? I could fix & test that one as well. |
I don't. :( |
|
Maybe @sev- does, he added it in d35cdf5, only 7 years ago. :-) Looking at https://docs.scummvm.org/en/latest/help/release.html#myst-ery-u-f-o-s-release-2016-10-17 doesn't show me anything concrete to identify the codec... |
|
IIRC, that was for the GNAP engine. |
|
Tried to run U.F.O.s on my Linux and while it has quite amusing animations and gameplay, I wasn't able to hit the decode4 function. Since I know better than fixing code which I can't test afterwards, I propose to take this PR as is since it fixes something which I can verify and doesn't seem to break anything else. |
|
The testbed engine has a generic video player that can be used for testing codec changes. It's currently hardcoded to use the QuickTime decoder, but that can be swapped with a different one with relative ease. The testbed changes in PR #4736 improve this feature further. |
c5271ab to
61b1220
Compare
Fixes #14356.
|
Okay, thank you! |
Fixes 14356.
It's possible that there's more bugs like this but I can't test it as this was the first occasion where I saw something corrupted.
For instance
MSRLE4Decoder::decode4uses a slightly inefficient but safegetBasePtr(x, y)(which implicitly uses surface pitch) but I think this line:byte *output_end = (byte *)_surface->getBasePtr(_surface->w, y);is wrong -- technically speaking, nothing will be written past the allocated memory but the algorithm is writing past
widthpixels in the unused surface area.