From cbaf9a83862d37e0fffabff5076a2d78dd6aba2e Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 31 May 2024 21:39:13 +1000 Subject: [PATCH] Avoid implicit reliance on memcpy due to large structure copy --- src/SystemFonts.c | 2 +- src/freetype/pshints.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SystemFonts.c b/src/SystemFonts.c index e146251b9..d2c9d9534 100644 --- a/src/SystemFonts.c +++ b/src/SystemFonts.c @@ -320,7 +320,7 @@ void* cc_memchr(const void* ptr, int ch, size_t num) { for (; num > 0; num--, a++) { - if (*a == ch) return a; + if (*a == ch) return (void*)a; } return NULL; } diff --git a/src/freetype/pshints.c b/src/freetype/pshints.c index f352c787e..3762f352f 100644 --- a/src/freetype/pshints.c +++ b/src/freetype/pshints.c @@ -1703,7 +1703,7 @@ FALSE ); /* save a copy of current HintMap to use when drawing initial point */ - glyphpath->firstHintMap = glyphpath->hintMap; /* structure copy */ + ft_memcpy(&glyphpath->firstHintMap, &glyphpath->hintMap, sizeof(glyphpath->hintMap)); }