aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--video/coktel_decoder.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp
index fd9c2be8ed..a4bf2d2e19 100644
--- a/video/coktel_decoder.cpp
+++ b/video/coktel_decoder.cpp
@@ -1377,7 +1377,10 @@ bool IMDDecoder::renderFrame(Common::Rect &rect) {
if ((type == 2) && (rect.width() == _surface.w) && (_x == 0)) {
// Directly uncompress onto the video surface
- deLZ77((byte *)_surface.pixels + (_y * _surface.pitch), dataPtr, dataSize,
+ int offsetX = rect.left * _surface.bytesPerPixel;
+ int offsetY = (_y + rect.top) * _surface.pitch;
+
+ deLZ77((byte *)_surface.pixels + offsetX + offsetY, dataPtr, dataSize,
_surface.w * _surface.h * _surface.bytesPerPixel);
return true;
}
@@ -2241,7 +2244,10 @@ bool VMDDecoder::renderFrame(Common::Rect &rect) {
if ((type == 2) && (rect.width() == _surface.w) && (_x == 0) && (_blitMode == 0)) {
// Directly uncompress onto the video surface
- deLZ77((byte *)_surface.pixels + (_y * _surface.pitch), dataPtr, dataSize,
+ int offsetX = rect.left * _surface.bytesPerPixel;
+ int offsetY = (_y + rect.top) * _surface.pitch;
+
+ deLZ77((byte *)_surface.pixels + offsetX + offsetY, dataPtr, dataSize,
_surface.w * _surface.h * _surface.bytesPerPixel);
return true;
}