winhelp: fix LZ77 decompressor patch: what's wrong?
HolyLich
lich at math.spbu.ru
Fri Aug 11 05:58:35 CDT 2006
Hi,
I've sent patch several times, but it has not been applied.
Patch is reasonable, MIME type is OK.
patch -p0 < mbox works ;-) (as recommended at http://winehq.org/site/docs/winedev-guide/style-notes)
Please, tell what I must do to this patch to be applied?
Thanks a lot
-- HolyLich
Subject: [RESENDv2] winhelp: fix LZ77 decompressor
Date: Thursday 10 August 2006 14:21
From: HolyLich <lich at math.spbu.ru>
To: wine-patches at winehq.org
Hi,
This patch fixes a bug in LZ77 decompressor which affected only large (>0x1000)
compressed embedded files, e.g. images (metafiles). I've never noticed it corrupting
small images, but it may.
I sent this patch before but messed with MIME. Now it's OK.
ChangeLog:
winhelp: Fix LZ77 decompressor
-------------------------------------------------------
-------------- next part --------------
Index: programs/winhelp/hlpfile.c
===================================================================
RCS file: /home/wine/wine/programs/winhelp/hlpfile.c,v
retrieving revision 1.29
diff -u -p -r1.29 hlpfile.c
--- programs/winhelp/hlpfile.c 23 May 2006 12:49:31 -0000 1.29
+++ programs/winhelp/hlpfile.c 10 Aug 2006 10:05:47 -0000
@@ -1498,8 +1498,17 @@ static BYTE *HLPFILE_UncompressLZ77(BYTE
int code = GET_USHORT(ptr, 0);
int len = 3 + (code >> 12);
int offset = code & 0xfff;
- memcpy(newptr, newptr - offset - 1, len);
- newptr += len;
+ /*
+ * We must copy byte-by-byte here. We cannot use memcpy here -
+ * areas are overlaps, so it's behaviour is unpredictable
+ * (memcpy DOES NOT copy byte-by-byte because of some
+ * optimizations).
+ * bcopy also fails, it behaves like memmove, non memcpy.
+ *
+ * WINE versions of memcpy/memmove cannot be used by the
+ * same reasons.
+ */
+ for (; len>0; len--, newptr++) *newptr = *(newptr-offset-1);
ptr += 2;
}
else *newptr++ = *ptr++;
More information about the wine-devel
mailing list