mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-22 12:11:34 +00:00
fix a server crash on attempting to checksum a model that isn't there
This commit is contained in:
parent
de137aa864
commit
a01e68a148
1 changed files with 6 additions and 4 deletions
|
@ -280,14 +280,16 @@ SV_CheckModel (char *mdl)
|
||||||
{
|
{
|
||||||
byte stackbuf[1024]; // avoid dirtying the cache heap
|
byte stackbuf[1024]; // avoid dirtying the cache heap
|
||||||
byte *buf;
|
byte *buf;
|
||||||
unsigned short crc;
|
unsigned short crc = 0;
|
||||||
|
|
||||||
// int len;
|
// int len;
|
||||||
|
|
||||||
buf = (byte *) COM_LoadStackFile (mdl, stackbuf, sizeof (stackbuf));
|
buf = (byte *) COM_LoadStackFile (mdl, stackbuf, sizeof (stackbuf));
|
||||||
crc = CRC_Block (buf, com_filesize);
|
if (buf) {
|
||||||
// for (len = com_filesize; len; len--, buf++)
|
crc = CRC_Block (buf, com_filesize);
|
||||||
// CRC_ProcessByte(&crc, *buf);
|
} else {
|
||||||
|
Con_Printf ("WARNING: cannot generate checksum for %s\n", mdl);
|
||||||
|
}
|
||||||
|
|
||||||
return crc;
|
return crc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue