Gtk: fixed potential crash by misusage of intersectRect.

git-svn-id: trunk@27881 -
This commit is contained in:
zeljko 2010-10-26 12:10:08 +00:00
parent 400281ddea
commit 214a49925d

View File

@ -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;