From 2d11c8bbf59b9aae95efec79ca7d8efe33ab945d Mon Sep 17 00:00:00 2001 From: nillerusr Date: Thu, 3 Dec 2020 22:45:22 +0300 Subject: [PATCH] pixelwriter: fix undefined behaviour --- public/pixelwriter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/pixelwriter.h b/public/pixelwriter.h index 5c510553..4c3c8b4f 100644 --- a/public/pixelwriter.h +++ b/public/pixelwriter.h @@ -507,7 +507,7 @@ FORCEINLINE_PIXEL void CPixelWriter::WritePixelNoAdvance( int r, int g, int b, i { if ( IsPC() || !IsX360() ) { - ((unsigned short *)m_pBits)[0] = (unsigned short)((val & 0xffff)); + ((unsigned char *)m_pBits)[0] = (unsigned char)((val & 0xffff)); m_pBits[2] = (unsigned char)((val >> 16) & 0xff); } else