flate: fix wrong adler32() length calculation (thanks qrstuv)

This commit is contained in:
cinap_lenrek 2014-12-20 03:34:40 +01:00
parent ffe862c543
commit 8ac28ac11c

View file

@ -61,7 +61,7 @@ inflatezlibblock(uchar *dst, int dsize, uchar *src, int ssize)
if(ok != FlateOk)
return ok;
if(adler32(1, dst, bs.pos - dst) != ((bs.pos[0] << 24) | (bs.pos[1] << 16) | (bs.pos[2] << 8) | bs.pos[3]))
if(adler32(1, dst, bd.pos - dst) != ((bs.pos[0] << 24) | (bs.pos[1] << 16) | (bs.pos[2] << 8) | bs.pos[3]))
return FlateCorrupted;
return bd.pos - dst;