From d5c41c0816d797124acf35bf32a208d431119f5b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 08:54:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Stop=20multimap=20decode=20from?= =?UTF-8?q?=20spinning=20on=20truncated=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A failed or zero-length run read left the decoder looping forever without consuming input. --- UOLib/UMultiMap.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/UOLib/UMultiMap.pas b/UOLib/UMultiMap.pas index 3998e76..f3874cb 100644 --- a/UOLib/UMultiMap.pas +++ b/UOLib/UMultiMap.pas @@ -69,7 +69,13 @@ begin begin while (x < width) and (y < height) do begin - Data.Read(pixelData, SizeOf(Byte)); + if (Data.Read(pixelData, SizeOf(Byte)) < SizeOf(Byte)) or + (pixelData and $7F = 0) then + begin + x := width; + y := height; + Break; + end; if (pixelData and $80) = $80 then color := clBlack else color := clWhite; for run := 1 to (pixelData and $7F) do begin