🐛 Free the client statics decode buffer on malformed data

This commit is contained in:
2026-11-15 22:06:51 +01:00
parent d9f7b126b6
commit 3df6ab93f6
+3
View File
@@ -523,6 +523,7 @@ begin
begin begin
AData.Position := AIndex.Lookup; AData.Position := AIndex.Lookup;
block := TMemoryStream.Create; block := TMemoryStream.Create;
try
block.CopyFrom(AData, AIndex.Size); block.CopyFrom(AData, AIndex.Size);
block.Position := 0; block.Position := 0;
for i := 1 to (AIndex.Size div 7) do for i := 1 to (AIndex.Size div 7) do
@@ -530,8 +531,10 @@ begin
item := TStaticItem.Create(Self, block, AX, AY); item := TStaticItem.Create(Self, block, AX, AY);
Cells[(item.Y mod 8) * 8 + (item.X mod 8)].Add(item); Cells[(item.Y mod 8) * 8 + (item.X mod 8)].Add(item);
end; end;
finally
block.Free; block.Free;
end; end;
end;
end; end;
constructor TSeperatedStaticBlock.Create(AData: TStream; AIndex: TGenericIndex); constructor TSeperatedStaticBlock.Create(AData: TStream; AIndex: TGenericIndex);