Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match XLib graphics api parameter to prevent range check error #102

Open
devEric69 opened this issue Oct 6, 2020 · 0 comments
Open

Match XLib graphics api parameter to prevent range check error #102

devEric69 opened this issue Oct 6, 2020 · 0 comments
Assignees

Comments

@devEric69
Copy link

devEric69 commented Oct 6, 2020

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

@graemeg graemeg self-assigned this Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants