From 47eda4bcf76252b2c9be2427c897884449073394 Mon Sep 17 00:00:00 2001 From: Adrian Frühwirth Date: Fri, 26 Jan 2018 20:38:53 +0100 Subject: TUCKER: Fix clipping handling when drawing text Fixes Trac#10422. --- engines/tucker/graphics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/tucker') diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp index b9c184e2bb..64ec81cb2a 100644 --- a/engines/tucker/graphics.cpp +++ b/engines/tucker/graphics.cpp @@ -170,10 +170,10 @@ void Graphics::drawStringChar(uint8 *dst, int xDst, int yDst, int pitch, uint8 c const int w = MIN(_charset._charW, pitch - xDst); dst += yDst * pitch + xDst; int offset = (chr - 32) * _charset._charH * _charset._charW; - for (int y = 0; y < h; ++y) { - for (int x = 0; x < w; ++x) { - const int color = src[offset++]; - if (color != 0) { + for (int y = 0; y < _charset._charH; ++y) { + for (int x = 0; x < _charset._charW; ++x, ++offset) { + const int color = src[offset]; + if (y < h && x < w && color != 0) { if (_charsetType == kCharsetTypeCredits) { dst[x] = color; } else { -- cgit v1.2.3