fpGUI
fpGUI copied to clipboard
Match XLib graphics api parameter to prevent range check error
Hello,
This 2 modifications can prevent prevent another range check error ( the TXRectangle.Width and TXRectangle.Height are typed as Word i.e. (0..65535) ) in fpg_x11:
procedure TfpgX11Canvas.DoSetClipRect(const ARect: TfpgRect);
var
r: TXRectangle;
rg: TRegion;
begin
r.x := ARect.Left;
r.y := ARect.Top;
r.Width := Max(ARect.Width, 0); //++--
r.Height := Max(ARect.Height, 0); //++--
...\...
procedure TfpgX11Canvas.DoAddClipRect(const ARect: TfpgRect);
var
r: TXRectangle;
rg: TRegion;
begin
r.x := ARect.Left;
r.y := ARect.Top;
r.Width := Max(ARect.Width, 0); //++--
r.Height := Max(ARect.Height, 0); //++--
...\...
Regards