mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-10 15:39:14 +01:00
Gtk: fixed potential crash by misusage of intersectRect.
git-svn-id: trunk@27881 -
This commit is contained in:
parent
400281ddea
commit
214a49925d
@ -2160,7 +2160,7 @@ var
|
||||
end;
|
||||
|
||||
var
|
||||
R: TRect;
|
||||
R, R1: TRect;
|
||||
UseAlpha: Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
@ -2182,7 +2182,8 @@ begin
|
||||
if ARect <> nil
|
||||
then begin
|
||||
// get intersection
|
||||
IntersectRect(R, ARect^, R);
|
||||
IntersectRect(R1, ARect^, R);
|
||||
R := R1;
|
||||
ADesc.Width := R.Right - R.Left;
|
||||
ADesc.Height := R.Bottom - R.Top;
|
||||
end;
|
||||
@ -2210,7 +2211,7 @@ var
|
||||
Pixbuf: PGdkPixbuf;
|
||||
pixels: pguchar;
|
||||
Dest: PByte;
|
||||
R: TRect;
|
||||
R, R1: TRect;
|
||||
i: Integer;
|
||||
SourceStride, DestStride: PtrUInt;
|
||||
begin
|
||||
@ -2233,7 +2234,8 @@ begin
|
||||
if ARect <> nil
|
||||
then begin
|
||||
// get intersection
|
||||
IntersectRect(R, ARect^, R);
|
||||
IntersectRect(R1, ARect^, R);
|
||||
R := R1;
|
||||
ADesc.Width := R.Right - R.Left;
|
||||
ADesc.Height := R.Bottom - R.Top;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user