From 9f1f5057c99e3f5e2b196d7da9995d8fd8fcaae1 Mon Sep 17 00:00:00 2001 From: Adrian Frühwirth Date: Sun, 25 Feb 2018 16:21:29 +0100 Subject: TUCKER: Fix theoretical out-of-bounds read --- engines/tucker/graphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tucker/graphics.cpp') diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp index 7b17bd0252..3a6bd227b4 100644 --- a/engines/tucker/graphics.cpp +++ b/engines/tucker/graphics.cpp @@ -122,7 +122,7 @@ void Graphics::decodeRLE_248(uint8 *dst, const uint8 *src, int w, int h, int y1, } } if (color != 0) { - if (( (whitelistReservedColors != nullptr && (*(whitelistReservedColors + dst[offset] - 0xE0) == 1) && dst[offset] <= 0xEF) || dst[offset] < 0xE0 || y + y1 < y2) && dst[offset] < 0xF8) { + if (( (whitelistReservedColors != nullptr && (dst[offset] & 0xE0) == 0xE0 && *(whitelistReservedColors + dst[offset] - 0xE0) == 1) || dst[offset] < 0xE0 || y + y1 < y2) && dst[offset] < 0xF8) { dst[offset] = color; } } else { -- cgit v1.2.3