mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 01:01:07 +00:00
lodepng.c: max 5552 instead of 5550 sums before adler32 overflow
(lorepng github mainstream commit 81cf5de55f) git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1585 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
7ad20fe4ab
commit
0825fb705c
1 changed files with 4 additions and 4 deletions
|
@ -2090,13 +2090,13 @@ static unsigned deflate(unsigned char** out, size_t* outsize,
|
|||
|
||||
static unsigned update_adler32(unsigned adler, const unsigned char* data, unsigned len)
|
||||
{
|
||||
unsigned s1 = adler & 0xffff;
|
||||
unsigned s2 = (adler >> 16) & 0xffff;
|
||||
unsigned s1 = adler & 0xffff;
|
||||
unsigned s2 = (adler >> 16) & 0xffff;
|
||||
|
||||
while(len > 0)
|
||||
{
|
||||
/*at least 5550 sums can be done before the sums overflow, saving a lot of module divisions*/
|
||||
unsigned amount = len > 5550 ? 5550 : len;
|
||||
/*at least 5552 sums can be done before the sums overflow, saving a lot of module divisions*/
|
||||
unsigned amount = len > 5552 ? 5552 : len;
|
||||
len -= amount;
|
||||
while(amount > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue