fixed a nasty relocation handling error which could produce broken

compressed files

committer: ml1050 <ml1050> 1126865811 +0000
This commit is contained in:
László Molnár 2005-09-16 10:16:51 +00:00
parent 0337bdb9fd
commit eb6c51426a

View File

@ -293,7 +293,9 @@ unsigned optimize_relocs(upx_byte *b, const unsigned size,
{
addr = get_le32(relocs+4*i);
//printf ("%x\n",es*16+di);
if (addr - es*16 > 0xfffe)
if ((addr - es*16 > 0xfffe)
|| (i == nrelocs - 1 && addr - es * 16 > 0xff00)
)
{
// segment change
t = 1+(0xffff-di)/254;