fpGUI icon indicating copy to clipboard operation
fpGUI copied to clipboard

Match XLib graphics api parameter to prevent range check error

Open infologick opened this issue 5 years ago • 0 comments

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

infologick avatar Oct 06 '20 09:10 infologick