From 3df6ab93f610266482811dc4e8c27848834605a4 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 09:06:58 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Free=20the=20client=20statics=20?= =?UTF-8?q?decode=20buffer=20on=20malformed=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/ULandscape.pas | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Client/ULandscape.pas b/Client/ULandscape.pas index e69d1cd..3a8f852 100644 --- a/Client/ULandscape.pas +++ b/Client/ULandscape.pas @@ -523,14 +523,17 @@ begin begin AData.Position := AIndex.Lookup; block := TMemoryStream.Create; - block.CopyFrom(AData, AIndex.Size); - block.Position := 0; - for i := 1 to (AIndex.Size div 7) do - begin - item := TStaticItem.Create(Self, block, AX, AY); - Cells[(item.Y mod 8) * 8 + (item.X mod 8)].Add(item); + try + block.CopyFrom(AData, AIndex.Size); + block.Position := 0; + for i := 1 to (AIndex.Size div 7) do + begin + item := TStaticItem.Create(Self, block, AX, AY); + Cells[(item.Y mod 8) * 8 + (item.X mod 8)].Add(item); + end; + finally + block.Free; end; - block.Free; end; end;