mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 21:00:34 +02:00
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:
parent
3db0a7ec0f
commit
1dd55f7ae0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user