mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- fixed buffer size checks for raw textures.
This commit is contained in:
parent
0e5c6e37b1
commit
4e4642d0ed
1 changed files with 3 additions and 3 deletions
|
@ -94,7 +94,7 @@ bool CheckIfRaw(FileReader & data, int desiredsize)
|
|||
{
|
||||
gapAtStart = false;
|
||||
}
|
||||
else if (ofs >= 64000-1) // Need one byte for an empty column
|
||||
else if (ofs >= desiredsize-1) // Need one byte for an empty column
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ bool CheckIfRaw(FileReader & data, int desiredsize)
|
|||
{
|
||||
// Ensure this column does not extend beyond the end of the patch
|
||||
const uint8_t *foo2 = (const uint8_t *)foo;
|
||||
while (ofs < 64000)
|
||||
while (ofs < desiredsize)
|
||||
{
|
||||
if (foo2[ofs] == 255)
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ bool CheckIfRaw(FileReader & data, int desiredsize)
|
|||
}
|
||||
ofs += foo2[ofs+1] + 4;
|
||||
}
|
||||
if (ofs >= 64000)
|
||||
if (ofs >= desiredsize)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue