[Bug 3336] X Error (X_Create_Pixmap) when patch applied to xorg-x11 6.8.2 (Gentoo)

Wine Bugs wine-bugs at winehq.org
Sat Sep 17 07:10:00 CDT 2005


http://bugs.winehq.org/show_bug.cgi?id=3336





------- Additional Comments From pete4abw at comcast.net  2005-17-09 07:10 -------
https://bugs.freedesktop.org/show_bug.cgi?id=594, comment 25 seems to bring up
an issue:

------- Additional comment #25  from Egbert Eich on 2005-09-13 03:55  [reply]
-------

To round this up here is the explanation for the devision by 4 in:
+    if (paddedWidth / 4 > 32767 || height > 32767)
+	return NullPixmap;

We must meet the condition:
paddedWidth * height <= ((1 << (sizeof(size_t) << 3)) - 1)
so that we don't cause an overflow in the argument of a subsequent malloc()
and end up allocating less than the required amount.
size_t should be at least unsigned int therefore the maximum value it can hold
would be: 32767^2 * 4. height needs to be <= 32767 as it needs to fit into a
short. This condition should have been tested in the calling function - we do it
here again for safety.
------------------------
Apparently, this divide/multiply by 4 is causing the problem. There is no
official revised patch yet. I know the gentoo dev implemented it and I "heard"
it works, but it has not been released yet.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list