[Mono-bugs] [Bug 415581] New: IndexOutOfRangeException in Icon. ToBitmap if IconDirEnties were skipped

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Aug 7 15:28:04 EDT 2008


           Summary: IndexOutOfRangeException in Icon.ToBitmap if
                    IconDirEnties were skipped
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Drawing.
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: gert.driesen at pandora.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

If an IconDirEntry for a 256x256 icon was skipped before the "best fit" icon is
encountered, then the id of that best fit icon is not correct, which can lead
to an IndexOutOfRangeException in ToBitmap (actually GetInternalBitmap) on

To reproduce:
1. extract the attached gzipped tar archive.
2. compile test.cs.
3. run it

Actual result:

Unhandled Exception: System.IndexOutOfRangeException: Array index is out of
  at System.Drawing.Icon.BuildBitmapOnWin32 () [0x00000]
  at System.Drawing.Icon.GetInternalBitmap () [0x00000]
  at System.Drawing.Icon.ToBitmap () [0x00000]
  at (wrapper remoting-invoke-with-check) System.Drawing.Icon:ToBitmap ()
  at Program.Main () [0x00000]

Expected result:

#A={Width=48, Height=48}
#B={Width=48, Height=48}

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