LCL: Fix memory allocation by TCustomImageListResolution (patch by Ondrej Pokorny, issue #34708, see also https://forum.lazarus.freepascal.org/index.php/topic,43525.msg305115.html#msg305115).

git-svn-id: trunk@59880 -
This commit is contained in:
wp 2018-12-20 16:54:11 +00:00
parent 8fe535d1e4
commit 5fabf10223

View File

@ -326,14 +326,13 @@ begin
if n <> 0
then Inc(ACount, FImageList.FAllocBy - n);
SetLength(FData, ACount * FWidth * FHeight * SizeOf(FData[0]));
Inc(FAllocCount, ACount);
SetLength(FData, ACount * FWidth * FHeight);
FAllocCount := ACount;
end;
procedure TCustomImageListResolution.CheckIndex(AIndex: Integer;
AForInsert: Boolean);
// aviod exceptionframe generation
// avoid exceptionframe generation
procedure Error;
begin
raise EInvalidOperation.Create(SInvalidIndex);