From 2de386c5310bd2f6494ee7994ff3e5096b75ff0b Mon Sep 17 00:00:00 2001 From: zeljko Date: Fri, 21 Dec 2018 16:56:47 +0000 Subject: [PATCH] LCL: ImgList - reverted r59880 and r59888 #5e3ff3cf84 because of crashes on non win32 widgetsets. issue #34708 git-svn-id: trunk@59889 - --- lcl/include/imglist.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index 89feaf46a5..2f154d0117 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -326,13 +326,14 @@ begin if n <> 0 then Inc(ACount, FImageList.FAllocBy - n); - SetLength(FData, ACount * FWidth * FHeight); - FAllocCount := ACount; + SetLength(FData, ACount * FWidth * FHeight * SizeOf(FData[0])); + + Inc(FAllocCount, ACount); end; procedure TCustomImageListResolution.CheckIndex(AIndex: Integer; AForInsert: Boolean); - // avoid exceptionframe generation + // aviod exceptionframe generation procedure Error; begin raise EInvalidOperation.Create(SInvalidIndex); @@ -1459,7 +1460,7 @@ begin ToR.AllocData(ToR.FCount); if ToR.FCount>0 then begin - DataSize := ToR.FWidth * ToR.FHeight; {issue #34708 * SizeOf(FData[0])}; + DataSize := ToR.FWidth * ToR.FHeight * SizeOf(FData[0]); System.Move(FromR.FData[0], ToR.FData[0], ToR.FCount * DataSize); end; end;