diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2025-04-09 23:54:13 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2025-04-09 23:54:13 +1200 |
commit | a41dedec645a0894d9173e5de0b502f727572f62 (patch) | |
tree | 808cba7c49925deca77b738eaa69e05132bbc834 /spec/fltk-images-rgb.ads | |
parent | 8d8ecd6db517cb208ef165785575287568e5a175 (diff) |
Fixed RGB_Image size_t issue, RGB_Image/Bitmap preconditions
Diffstat (limited to 'spec/fltk-images-rgb.ads')
-rw-r--r-- | spec/fltk-images-rgb.ads | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/fltk-images-rgb.ads b/spec/fltk-images-rgb.ads index daa31c6..242098a 100644 --- a/spec/fltk-images-rgb.ads +++ b/spec/fltk-images-rgb.ads @@ -6,7 +6,8 @@ with - FLTK.Images.Pixmaps; + FLTK.Images.Pixmaps, + System.Storage_Elements; package FLTK.Images.RGB is @@ -19,16 +20,18 @@ package FLTK.Images.RGB is type RGB_Image_Array is array (Positive range <>) of RGB_Image; + type Size_Type is mod 2 ** System.Storage_Elements.Integer_Address'Size; + -- Static Settings -- function Get_Max_Size - return Natural; + return Size_Type; procedure Set_Max_Size - (Value : in Natural); + (Value : in Size_Type); @@ -45,8 +48,8 @@ package FLTK.Images.RGB is Line_Size : in Natural := 0) return RGB_Image with Pre => (if Line_Size = 0 - then Data'Length = Width * Height * Depth - else Data'Length = Line_Size * Height) + then Data'Length >= Width * Height * Depth + else Data'Length >= Line_Size * Height) and Data'Length <= Get_Max_Size; function Create |