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