Henri Verbeet : usp10: Use memmove() in GSUB_apply_LigatureSubst().

Alexandre Julliard julliard at winehq.org
Wed Mar 1 16:45:10 CST 2017


Module: wine
Branch: master
Commit: bab506e1cd99d1284cb6bfe05610a2416d04b6c6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bab506e1cd99d1284cb6bfe05610a2416d04b6c6

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Mar  1 07:14:55 2017 +0100

usp10: Use memmove() in GSUB_apply_LigatureSubst().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/usp10/opentype.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c
index 4f3b559..3bbf5ec 100644
--- a/dlls/usp10/opentype.c
+++ b/dlls/usp10/opentype.c
@@ -1058,9 +1058,8 @@ static INT GSUB_apply_LigatureSubst(const OT_LookupTable *look, WORD *glyphs, IN
                     TRACE("0x%x\n",glyphs[replaceIdx]);
                     if (CompCount > 0)
                     {
-                        int j;
-                        for (j = replaceIdx + 1; j < *glyph_count; j++)
-                            glyphs[j] =glyphs[j+CompCount];
+                        unsigned int j = replaceIdx + 1;
+                        memmove(&glyphs[j], &glyphs[j + CompCount], (*glyph_count - j) * sizeof(*glyphs));
                         *glyph_count = *glyph_count - CompCount;
                     }
                     return replaceIdx + write_dir;




More information about the wine-cvs mailing list