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:
Ozkan Sezer 2018-05-30 04:04:47 +00:00
parent 7ad20fe4ab
commit 0825fb705c

View file

@ -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)
{