aboutsummaryrefslogtreecommitdiff
path: root/body/fltk-images-rgb-jpeg.adb
diff options
context:
space:
mode:
Diffstat (limited to 'body/fltk-images-rgb-jpeg.adb')
-rw-r--r--body/fltk-images-rgb-jpeg.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/body/fltk-images-rgb-jpeg.adb b/body/fltk-images-rgb-jpeg.adb
index 8706778..61d06e6 100644
--- a/body/fltk-images-rgb-jpeg.adb
+++ b/body/fltk-images-rgb-jpeg.adb
@@ -81,7 +81,9 @@ package body FLTK.Images.RGB.JPEG is
return This : JPEG_Image do
This.Void_Ptr := new_fl_jpeg_image2
(Interfaces.C.To_C (Name),
- Storage.To_Integer (Data (Data'First)'Address));
+ (if Data'Length > 0
+ then Storage.To_Integer (Data (Data'First)'Address)
+ else Null_Pointer));
Raise_Fail_Errors (This);
end return;
end Create;