mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-16 09:11:21 +00:00
added missing file size validation in the voxel loader, anything below 772 bytes cannot be a valid KVX file.
This commit is contained in:
parent
f796e55c0d
commit
0c5780cc41
1 changed files with 1 additions and 0 deletions
|
@ -164,6 +164,7 @@ FVoxel *R_LoadKVX(int lumpnum)
|
|||
auto lump = fileSystem.ReadFile(lumpnum); // FileData adds an extra 0 byte to the end.
|
||||
auto rawvoxel = lump.bytes();
|
||||
int voxelsize = (int)(lump.size());
|
||||
if (voxelsize <= 768 + 4) return nullptr;
|
||||
|
||||
// Oh, KVX, why couldn't you have a proper header? We'll just go through
|
||||
// and collect each MIP level, doing lots of range checking, and if the
|
||||
|
|
Loading…
Reference in a new issue