LCL: Don't access first element of ImageList if length=0. Issue #23834, patch from wp

git-svn-id: trunk@40192 -
This commit is contained in:
juha 2013-02-05 21:39:16 +00:00
parent 3db0a7ec0f
commit 1dd55f7ae0

View File

@ -1085,7 +1085,8 @@ begin
WriteLRSInteger(AStream,Height);
//images
AStream.Write(FData[0], FWidth * FHeight * FCount * SizeOf(FData[0]));
if Count > 0 then
AStream.Write(FData[0], FWidth * FHeight * FCount * SizeOf(FData[0]));
end;
{------------------------------------------------------------------------------
@ -1161,7 +1162,8 @@ var
FHeight := ReadLRSCardinal(AStream);
AllocData(FCount);
AStream.ReadBuffer(FData[0], FWidth * FHeight * FCount * SizeOf(FData[0])) ;
if FCount > 0 then
AStream.ReadBuffer(FData[0], FWidth * FHeight * FCount * SizeOf(FData[0])) ;
FChanged := true;
Change;