mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +00:00
More endian bugs fixed. Swap table contents before doing Com_BlockChecksum, swap the generated checksum before comparison.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2216 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
c60d2e48c1
commit
6394eec60a
1 changed files with 4 additions and 1 deletions
|
@ -671,8 +671,11 @@ void Huff_Init( int *huffCounts ) {
|
||||||
for( j=0 ; j<huffCounts[i] ; j++ ) {
|
for( j=0 ; j<huffCounts[i] ; j++ ) {
|
||||||
Huff_AddReference( huffTree, i );
|
Huff_AddReference( huffTree, i );
|
||||||
}
|
}
|
||||||
|
huffCounts[i] = LittleLong(huffCounts[i]);
|
||||||
}
|
}
|
||||||
madetable=Com_BlockChecksum(huffCounts, sizeof(huffCounts));
|
madetable=Com_BlockChecksum(huffCounts, sizeof(huffCounts));
|
||||||
|
for(i=0;i<256;i++)
|
||||||
|
huffCounts[i] = LittleLong(huffCounts[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Huff_LoadTable(char *filename)
|
void Huff_LoadTable(char *filename)
|
||||||
|
@ -690,7 +693,7 @@ qboolean Huff_CompressionCRC(int crc)
|
||||||
{
|
{
|
||||||
if (!madetable)
|
if (!madetable)
|
||||||
Huff_Init(NULL);
|
Huff_Init(NULL);
|
||||||
if (crc != madetable)
|
if (crc != LittleLong(madetable))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue