[Mono-bugs] [Bug 406307] New: System.Drawing.Image.SetPropertyItem throws an Exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jul 3 16:15:50 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=406307


           Summary: System.Drawing.Image.SetPropertyItem throws an Exception
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Drawing.
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: rob.h at gmx.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=225896)
 --> (https://bugzilla.novell.com/attachment.cgi?id=225896)
Code to reproduce the bug

SetPropertyItem throws the following exception. Code to reproduce is attached.
The picture from <http://www.exiv2.org/include/img_2158.jpg> is used in the
code.

Unhandled Exception: System.ArgumentNullException: Argument cannot be null.
Parameter name: src
  at (wrapper managed-to-native)
System.Runtime.InteropServices.Marshal:copy_from_unmanaged
(intptr,int,System.Array,int)
  at System.Runtime.InteropServices.Marshal.Copy (IntPtr source, System.Byte[]
destination, Int32 startIndex, Int32 length) [0x00000] 
  at System.Drawing.GdipPropertyItem.MarshalTo (GdipPropertyItem gdipProp,
System.Drawing.Imaging.PropertyItem prop) [0x00000] 
  at System.Drawing.Image.SetPropertyItem (System.Drawing.Imaging.PropertyItem
propitem) [0x00000] 
  at (wrapper remoting-invoke-with-check) System.Drawing.Image:SetPropertyItem
(System.Drawing.Imaging.PropertyItem)
  at SetPropBug.MainClass.Main (System.String[] args) [0x00043] in
../Main.cs:19 

By looking at the code of SetPropertyItem, I guess that the IntPtr pi.Value is
not initialized and that's why Marshal.Copy complains. But could also be sth
different.

(The mono --version said I'm on 1.9.1 but I couldn't select it in the version
field of the bug tracker. (gmcs --version says 1.9.1.0))
(My Linux distro is Debian lenny, which is missing in the OS field.)


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list