Corrected RLE decompression processing.

This commit is contained in:
Kouji Sasaki 2005-05-18 09:42:52 +00:00 committed by Alexandre Julliard
parent 92000a91da
commit d840f2c114
1 changed files with 4 additions and 4 deletions

View File

@ -1790,18 +1790,18 @@ static void HLPFILE_UncompressRLE(const BYTE* src, const BYTE* end, BYTE** dst,
while (src < end)
{
ch = *src++;
if (!(ch & 0x7F)) continue;
if (ch & 0x80)
{
ch &= 0x7F;
if ((*dst) + ch < sdst)
if ((*dst) + ch <= sdst)
memcpy(*dst, src, ch);
src += ch;
}
else
{
if ((*dst) + ch < sdst)
memset(*dst, (char)*src++, ch);
if ((*dst) + ch <= sdst)
memset(*dst, (char)*src, ch);
src++;
}
*dst += ch;
}