forked from Mirrorlandia_minetest/irrlicht
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 (relativeMovement)
|
||||||
{
|
{
|
||||||
if (Pos + finalPos > Len)
|
const long newPos = Pos + finalPos;
|
||||||
|
if (newPos > Len || newPos < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Pos += finalPos;
|
Pos += finalPos;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (finalPos > Len)
|
if (finalPos > Len || finalPos < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Pos = finalPos;
|
Pos = finalPos;
|
||||||
|
Loading…
Reference in New Issue
Block a user