mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 04:20:19 +02:00
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:
parent
8fe535d1e4
commit
5fabf10223
@ -326,14 +326,13 @@ begin
|
|||||||
if n <> 0
|
if n <> 0
|
||||||
then Inc(ACount, FImageList.FAllocBy - n);
|
then Inc(ACount, FImageList.FAllocBy - n);
|
||||||
|
|
||||||
SetLength(FData, ACount * FWidth * FHeight * SizeOf(FData[0]));
|
SetLength(FData, ACount * FWidth * FHeight);
|
||||||
|
FAllocCount := ACount;
|
||||||
Inc(FAllocCount, ACount);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomImageListResolution.CheckIndex(AIndex: Integer;
|
procedure TCustomImageListResolution.CheckIndex(AIndex: Integer;
|
||||||
AForInsert: Boolean);
|
AForInsert: Boolean);
|
||||||
// aviod exceptionframe generation
|
// avoid exceptionframe generation
|
||||||
procedure Error;
|
procedure Error;
|
||||||
begin
|
begin
|
||||||
raise EInvalidOperation.Create(SInvalidIndex);
|
raise EInvalidOperation.Create(SInvalidIndex);
|
||||||
|
Loading…
Reference in New Issue
Block a user