mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fixed ParticleSystems and Files crashing instead of erroring when given bad sizes (issue #666)
This commit is contained in:
@@ -136,6 +136,9 @@ FileData *File::read(int64 size)
|
||||
int64 cur = tell();
|
||||
size = (size == ALL) ? max : size;
|
||||
|
||||
if (size < 0)
|
||||
throw love::Exception("Invalid read size.");
|
||||
|
||||
// Clamping because the file offset may be in a weird position.
|
||||
if (cur < 0)
|
||||
cur = 0;
|
||||
|
||||
Reference in New Issue
Block a user