Lots of defect fixes

This commit is contained in:
Raul Tambre 2015-10-17 20:47:18 +03:00
parent 5dfc22a604
commit fac9d74344
21 changed files with 341 additions and 95 deletions

View file

@ -253,11 +253,17 @@ int decompress(unsigned char *out, unsigned char *in, unsigned int size)
// Underflow.
if (buf_start < out)
{
delete[] tmp;
return -1;
}
// Overflow.
if (buf_end > end)
{
delete[] tmp;
return -1;
}
// Update offset.
offset = ((((int)(buf_end - out)) + 1) & 1) + 6;