mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 07:19:18 +02:00
LCL: Detect an overflow in parameter values in some autosize situations.
git-svn-id: trunk@54372 -
This commit is contained in:
parent
3a47676ba3
commit
0a7346f015
@ -4301,6 +4301,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
Msg := LM_SIZE;
|
Msg := LM_SIZE;
|
||||||
SizeType := 6; // force realign
|
SizeType := 6; // force realign
|
||||||
|
if (FWidth < Low(Word)) or (FWidth > High(Word))
|
||||||
|
or (FHeight < Low(Word)) or (FHeight > High(Word)) then
|
||||||
|
raise Exception.CreateFmt('Size range overflow in %s.SendMoveSizeMessages:'
|
||||||
|
+' Width=%d, Height=%d.', [Name, FWidth, FHeight]);
|
||||||
Width := FWidth;
|
Width := FWidth;
|
||||||
Height := FHeight;
|
Height := FHeight;
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
@ -4317,8 +4321,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
Msg:= LM_MOVE;
|
Msg:= LM_MOVE;
|
||||||
MoveType:= 1;
|
MoveType:= 1;
|
||||||
XPos:= FLeft;
|
if (FLeft < Low(Smallint)) or (FLeft > High(Smallint))
|
||||||
YPos:= FTop;
|
or (FTop < Low(Smallint)) or (FTop > High(Smallint)) then
|
||||||
|
raise Exception.CreateFmt('Position range overflow in %s.SendMoveSizeMessages:'
|
||||||
|
+' Left=%d, Top=%d.', [Name, FLeft, FTop]);
|
||||||
|
XPos := FLeft;
|
||||||
|
YPos := FTop;
|
||||||
{$IFDEF CHECK_POSITION}
|
{$IFDEF CHECK_POSITION}
|
||||||
if CheckPosition(Self) then
|
if CheckPosition(Self) then
|
||||||
DebugLn(' [TControl.SendMoveSizeMessages] ',Name,':',ClassName,' MoveMsg XPos=',Dbgs(XPos),' YPos=',Dbgs(YPos));
|
DebugLn(' [TControl.SendMoveSizeMessages] ',Name,':',ClassName,' MoveMsg XPos=',Dbgs(XPos),' YPos=',Dbgs(YPos));
|
||||||
|
Loading…
Reference in New Issue
Block a user