mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 18:20:30 +02:00
Gtk2: do not crash inside PtInRegion if passed handle is not of HRGN type. issue #27080
git-svn-id: trunk@47056 -
This commit is contained in:
parent
d514d21370
commit
49d77cd1cc
@ -7041,8 +7041,17 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TGtk2WidgetSet.PtInRegion(RGN: HRGN; X, Y: Integer): Boolean;
|
||||
begin
|
||||
//todo: sanity checks for valid handle etc. eg. like CombineRgn
|
||||
Result := gdk_region_point_in({%H-}PGdiObject(RGN)^.GDIRegionObject, X, Y);
|
||||
Result := False;
|
||||
if not IsValidGDIObject(RGN) then
|
||||
exit;
|
||||
if (PGdiObject(RGN)^.GDIBitmapObject <> nil) or
|
||||
(PGdiObject(RGN)^.GDIPixbufObject <> nil) or
|
||||
(PGdiObject(RGN)^.GDIPixmapObject.Image <> nil) then
|
||||
begin
|
||||
// issue #27080
|
||||
Result := False;
|
||||
end else
|
||||
Result := gdk_region_point_in({%H-}PGdiObject(RGN)^.GDIRegionObject, X, Y);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user