[Mono-bugs] [Bug 72605][Wis] Changed - NullReferenceException, GdiPlus and rsh problem

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 16 Feb 2005 12:48:39 -0500 (EST)

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 bmaurer@users.sf.net.


--- shadow/72605	2005-02-16 12:32:24.000000000 -0500
+++ shadow/72605.tmp.12695	2005-02-16 12:48:39.000000000 -0500
@@ -547,6 +547,22 @@
 #1  0x4086a502 in GdipCreateBitmapFromScan0 (width=1000, height=1000,
 stride=4000, format=2498570, 
     scan0=0x0, bitmap=0x4bd839b8) at bitmap.c:177
 libgdiplus needs to be changed to deal gracefully with malloc
 returning NULL.
+------- Additional Comments From bmaurer@users.sf.net  2005-02-16 12:48 -------
+It would be nice to use g_malloc/g_new, as they check this for us, 
+and could be changed to throw an OOM exception rather than abort on 
+failure. (Is that how MSFT handles memory problems, it would be an 
+interesting testcase. I think they try to avoid letting managed code 
+cause an abort, as that would cause problems in eg IIS)
+FYI i noticed this:
+		scan0 = GdipAlloc (stride * height);
+		memset (scan0, 0, stride * height);
+That is really inefficient when the memory is mmap'd from the system 
+(which happens if it is more than 128 kb of data on glibc iirc). 
+Better to use calloc (or g_new0)