mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-10 09:43:52 +01:00
Prevent CMemoryFile to seek to a point before the start.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6348 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
3f2f98d7bd
commit
9504b3da21
@ -52,14 +52,15 @@ bool CMemoryReadFile::seek(long finalPos, bool relativeMovement)
|
||||
{
|
||||
if (relativeMovement)
|
||||
{
|
||||
if (Pos + finalPos > Len)
|
||||
const long newPos = Pos + finalPos;
|
||||
if (newPos > Len || newPos < 0)
|
||||
return false;
|
||||
|
||||
Pos += finalPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (finalPos > Len)
|
||||
if (finalPos > Len || finalPos < 0)
|
||||
return false;
|
||||
|
||||
Pos = finalPos;
|
||||
|
Loading…
Reference in New Issue
Block a user