mirror of
https://github.com/yquake2/ref_vk.git
synced 2024-12-02 16:31:51 +00:00
Fix BSPX:DecoupledLM header load
This commit is contained in:
parent
8a0797e484
commit
0e55c57bf0
1 changed files with 4 additions and 1 deletions
|
@ -452,7 +452,8 @@ Mod_LoadBSPX(int filesize, byte* mod_base)
|
||||||
header = (dheader_t*)mod_base;
|
header = (dheader_t*)mod_base;
|
||||||
xofs = 0;
|
xofs = 0;
|
||||||
for (i = 0; i < HEADER_LUMPS; i++) {
|
for (i = 0; i < HEADER_LUMPS; i++) {
|
||||||
xofs = max(xofs, header->lumps[i].fileofs + header->lumps[i].filelen);
|
xofs = max(xofs,
|
||||||
|
ROUNDUP(header->lumps[i].fileofs + header->lumps[i].filelen, sizeof(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xofs + sizeof(bspx_header_t) > filesize) {
|
if (xofs + sizeof(bspx_header_t) > filesize) {
|
||||||
|
@ -462,6 +463,8 @@ Mod_LoadBSPX(int filesize, byte* mod_base)
|
||||||
xheader = (bspx_header_t*)(mod_base + xofs);
|
xheader = (bspx_header_t*)(mod_base + xofs);
|
||||||
if (LittleLong(xheader->ident) != BSPXHEADER)
|
if (LittleLong(xheader->ident) != BSPXHEADER)
|
||||||
{
|
{
|
||||||
|
R_Printf(PRINT_ALL, "%s: Incorrect header ident.\n",
|
||||||
|
__func__, xheader->ident, BSPXHEADER);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue