Fixed #6267: adjust write_pixel_16 endian handling
authorakallabeth <akallabeth@posteo.net>
Mon, 8 Jun 2020 05:09:07 +0000 (07:09 +0200)
committerakallabeth <akallabeth@posteo.net>
Tue, 16 Jun 2020 07:09:11 +0000 (09:09 +0200)
(cherry picked from commit 51d3e07c8a4bca32bf82538075e4518b63e8ed4d)

libfreerdp/codec/interleaved.c

index e9f92c7..b76fe1c 100644 (file)
@@ -232,7 +232,8 @@ static INLINE void write_pixel_24(BYTE* _buf, UINT32 _pix)
 
 static INLINE void write_pixel_16(BYTE* _buf, UINT16 _pix)
 {
-       *(UINT16*)_buf = _pix;
+       _buf[0] = _pix & 0xFF;
+       _buf[1] = (_pix >> 8) & 0xFF;
 }
 
 #undef DESTWRITEPIXEL