[Mono-bugs] [Bug 667714] New: ImageIO/CGImageDestination.cs source code error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jan 27 13:44:58 EST 2011


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

https://bugzilla.novell.com/show_bug.cgi?id=667714#c0


           Summary: ImageIO/CGImageDestination.cs source code error
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: philippe.monteil at dolce-vista.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Customer
           Blocker: Yes


https://github.com/mono/maccore/blob/master/src/ImageIO/CGImageDestination.cs

The FromData/FromUrl methods call 
dict.Dispose ();
without checking that dict is non NULL, which causes a exception.

public static CGImageDestination FromData (NSData data, string typeIdentifier,
int imageCount, CGImageDestinationOptions options)
{
if (data == null)
throw new ArgumentNullException ("data");
if (typeIdentifier == null)
throw new ArgumentNullException ("typeIdentifier");

var dict = options == null ? null : options.ToDictionary ();
var ret = new CGImageDestination (CGImageDestinationCreateWithData
(data.Handle, new NSString (typeIdentifier).Handle, (IntPtr) imageCount, dict
== null ? IntPtr.Zero : dict.Handle));

// ERROR: dict is NULL most of the time
dict.Dispose ();

return ret;
}

Also, I would prefer that the method names match those of the wrapped API
function: FromData/FromUrl should be CreateWithData/CreateWithUrl
so as to ùake them easier to find and understand....

-- 
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