Fixed PATINVERT.
authorArmin Novak <armin.novak@thincast.com>
Tue, 19 Jul 2016 11:18:30 +0000 (13:18 +0200)
committerArmin Novak <armin.novak@thincast.com>
Thu, 6 Oct 2016 11:43:02 +0000 (13:43 +0200)
libfreerdp/gdi/brush.c
libfreerdp/gdi/region.c

index ca254b1..1e95a9d 100644 (file)
@@ -398,8 +398,9 @@ static BOOL BitBlt_PATINVERT(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
 
                                if (dstp)
                                {
-                                       color ^= color;
-                                       WriteColor(dstp, hdcDest->format, color);
+                                       UINT32 dstColor = ReadColor(dstp, hdcDest->format);
+                                       dstColor ^= color;
+                                       WriteColor(dstp, hdcDest->format, dstColor);
                                }
                        }
                }
index 28dbcfa..0907d1b 100644 (file)
 
 #include <freerdp/gdi/region.h>
 
+#include <freerdp/log.h>
+
+#define TAG FREERDP_TAG("gdi.region")
+
 /**
  * Create a region from rectangular coordinates.\n
  * @msdn{dd183514}
@@ -190,12 +194,12 @@ INLINE void gdi_CRgnToRect(UINT32 x, UINT32 y, UINT32 w, UINT32 h,
        if (w > 0)
                rect->right = x + w - 1;
        else
-               WLog_ERR("xxxxxx", "");
+               WLog_ERR(TAG, "Invalid width");
 
        if (h > 0)
                rect->bottom = y + h - 1;
        else
-               WLog_ERR("xxxxxx", "");
+               WLog_ERR(TAG, "Invalid height");
 }
 
 /**
@@ -233,8 +237,19 @@ INLINE void gdi_CRgnToCRect(UINT32 x, UINT32 y, UINT32 w, UINT32 h,
 {
        *left = x;
        *top = y;
-       *right = x + w - 1;
-       *bottom = y + h - 1;
+       *right = 0;
+
+       if (w > 0)
+               *right = x + w - 1;
+       else
+               WLog_ERR(TAG, "Invalid width");
+
+       *bottom = 0;
+
+       if (h > 0)
+               *bottom = y + h - 1;
+       else
+               WLog_ERR(TAG, "Invalid height");
 }
 
 /**