mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 03:56:12 +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
|
||||
Msg := LM_SIZE;
|
||||
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;
|
||||
Height := FHeight;
|
||||
{$IFDEF CHECK_POSITION}
|
||||
@ -4317,6 +4321,10 @@ begin
|
||||
begin
|
||||
Msg:= LM_MOVE;
|
||||
MoveType:= 1;
|
||||
if (FLeft < Low(Smallint)) or (FLeft > High(Smallint))
|
||||
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}
|
||||
|
Loading…
Reference in New Issue
Block a user