Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- CID 713109 (#1 of 1): Reliance on integer endianness (INCOMPATIBLE_CAST)
incompatible_cast: Pointer &uChar points to an object whose effective type is unsigned int (32 bits, unsigned) but is dereferenced as a narrower unsigned short (16 bits, unsigned). This may lead to unexpected results depending on machine endianness.
dlls/gdi32/font.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 17b160d2dc..3347c9208c 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -2817,6 +2817,8 @@ DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT uChar, UINT fuFormat, LPGLYPHMETRICS lpgm, DWORD cbBuffer, LPVOID lpBuffer, const MAT2 *lpmat2 ) { + WCHAR wChar; + if (!lpmat2) return GDI_ERROR;
if(!(fuFormat & GGO_GLYPH_INDEX)) { @@ -2833,8 +2835,9 @@ DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT uChar, UINT fuFormat, len = 1; mbchs[0] = (uChar & 0xff); } - uChar = 0; - MultiByteToWideChar(cp, 0, mbchs, len, (LPWSTR)&uChar, 1); + wChar = 0; + MultiByteToWideChar(cp, 0, mbchs, len, &wChar, 1); + uChar = wChar; }
return GetGlyphOutlineW(hdc, uChar, fuFormat, lpgm, cbBuffer, lpBuffer,