Fix Picture.fromFile for x86.

This commit is contained in:
haru-s 2024-06-18 22:57:07 +09:00
parent 5fa5f9a50a
commit 19a27ed5a1

View file

@ -1533,8 +1533,10 @@ class Picture: Image // docmain
/// ditto
static Picture fromFile(File file)
{
auto size = file.size();
ubyte[] buf = file.rawRead(new ubyte[size]);
ulong size = file.size();
if (size > size_t.max)
throw new DflException("DFL: Picture.fromFile failure by large file given.");
ubyte[] buf = file.rawRead(new ubyte[cast(size_t)size]);
return fromMemory(buf);
}