[Mono-bugs] [Bug 76844][Nor] Changed - Unlockbits fails
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Dec 1 23:24:58 EST 2005
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by 4lw0e0402 at sneakemail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=76844
--- shadow/76844 2005-11-29 17:37:27.000000000 -0500
+++ shadow/76844.tmp.3661 2005-12-01 23:24:57.000000000 -0500
@@ -1,13 +1,13 @@
Bug#: 76844
Product: Mono: Class Libraries
Version: unspecified
OS: unknown
OS Details:
-Status: NEW
-Resolution:
+Status: RESOLVED
+Resolution: FIXED
Severity: Unknown
Priority: Normal
Component: Windows.Forms
AssignedTo: peter at novonyx.com
ReportedBy: miguel at ximian.com
QAContact: mono-bugs at ximian.com
@@ -113,6 +113,27 @@
------- Additional Comments From peter at novonyx.com 2005-11-29 17:37 -------
Am CCing Jonathan Gilbert on this bug, he worked on (Un)LockBits as
part of his adding support for indexed images patch, he may have some
insight.
+
+------- Additional Comments From 4lw0e0402 at sneakemail.com 2005-12-01 23:24 -------
+Both of the examples are broken because they assume the data will be
+tightly-packed instead of using BitmapData's Stride member, but this
+was not evident because there is indeed a bug in UnlockBits :-)
+
+The bug was basically a typo:
+
+if ((locked_data->Reserved & GBD_READ_ONLY) != 0) {
+
+...should have been:
+
+if ((locked_data->Reserved & GBD_READ_ONLY) == 0) {
+
+However, this was in fact hiding a couple of deeper problems to do
+with 24-bit <-> 32-bit conversions. These required fixing, mostly in
+the pixel stream code.
+
+I have fixed all of these problems and will shortly attach a patch to
+this bug for review. If it passes, I can commit the changes directly.
+I will also add a regression test for this issue.
More information about the mono-bugs
mailing list