Skip to content

Instantly share code, notes, and snippets.

View ptsekov's full-sized avatar

Pavel Tsekov ptsekov

  • Sofia, Bulgaria
View GitHub Profile
diff --git a/client/Windows/wf_interface.c b/client/Windows/wf_interface.c
index 6ed2df7..8622269 100644
--- a/client/Windows/wf_interface.c
+++ b/client/Windows/wf_interface.c
@@ -104,8 +104,8 @@ void wf_sw_end_paint(wfContext* wfc)
update_rect.left = x;
update_rect.top = y;
- update_rect.right = x + w - 1;
- update_rect.bottom = y + h - 1;
@ptsekov
ptsekov / BitBlt_SRCINVERT_32bpp_keep_alpha.patch
Created July 29, 2014 12:36
BitBlt_SRCINVERT_32bpp(): Do no modify the alpha channel of the destination
Index: libfreerdp/gdi/32bpp.c
===================================================================
--- libfreerdp/gdi/32bpp.c (revision 3793)
+++ libfreerdp/gdi/32bpp.c (working copy)
@@ -327,7 +327,7 @@
{
for (x = 0; x < nWidth; x++)
{
- *dstp ^= *srcp;
+ *dstp ^= ((*srcp) & 0x00FFFFFF);
@ptsekov
ptsekov / bitmap_decode_SRCREADPIXEL_16bpp_fix.patch
Created July 25, 2014 15:13
Prevent unaligned access on older ARM processors when reading bitmaps for 16bpp session
Index: bitmap_decode.c
===================================================================
--- bitmap_decode.c (revision 2760)
+++ bitmap_decode.c (revision 2761)
@@ -219,7 +219,7 @@
#undef RLEEXTRA
#define DESTWRITEPIXEL(_buf, _pix) ((UINT16*)(_buf))[0] = (UINT16)(_pix)
#define DESTREADPIXEL(_pix, _buf) _pix = ((UINT16*)(_buf))[0]
-#define SRCREADPIXEL(_pix, _buf) _pix = ((UINT16*)(_buf))[0]
+#define SRCREADPIXEL(_pix, _buf) _pix = (_buf)[0] | ((_buf)[1] << 8)
@ptsekov
ptsekov / freerdp_mono_image_convert_argb32_abgr32_fix.patch
Created July 25, 2014 15:08
Fix freerdp_mono_image_convert() for 32bpp with clrconv->alpha set
Index: color.c
===================================================================
--- color.c (revision 3762)
+++ color.c (working copy)
@@ -1066,11 +1066,25 @@
{
if ((bitMask >> bitIndex) & 0x01)
{
- *dst32 = (clrconv->invert) ? BGR32(redBg, greenBg, blueBg) : RGB32(redBg, greenBg, blueBg);
+ if (clrconv->alpha)