Skip to content

Font Dump Throws an Exception #137

@Lego-Fan9

Description

@Lego-Fan9

It seems that loading a Font causes an Exception.

AssetStudio version: AssetStudioModGUI v0.18.0.0 [x64] [.NETCoreApp,Version=v8.0]
Unity version building bundle: 2022.3.62f2 (Have not tested others)

Replication:

  1. Create or source a importable object with a Font
  2. In the Asset List panel select your Font
  3. Preview will load, but when you press Dump (Next to the preview button, not under Export) it throws an Exception

The exception is:

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'startIndex')
   at System.BitConverter.ToInt16(Byte[] value, Int32 startIndex)
   at System.BitConverter.ToChar(Byte[] value, Int32 startIndex)
   at AssetStudio.TypeTreeHelper.ReadStringValue(StringBuilder sb, List`1 m_Nodes, BinaryReader reader, Int32& i) in L:\GIT\AssetStudioMod\AssetStudio\TypeTreeHelper.cs:line 46
   at AssetStudio.TypeTreeHelper.ReadStringValue(StringBuilder sb, List`1 m_Nodes, BinaryReader reader, Int32& i) in L:\GIT\AssetStudioMod\AssetStudio\TypeTreeHelper.cs:line 142
   at AssetStudio.TypeTreeHelper.ReadStringValue(StringBuilder sb, List`1 m_Nodes, BinaryReader reader, Int32& i) in L:\GIT\AssetStudioMod\AssetStudio\TypeTreeHelper.cs:line 154
   at AssetStudio.TypeTreeHelper.ReadTypeString(TypeTree m_Type, ObjectReader reader) in L:\GIT\AssetStudioMod\AssetStudio\TypeTreeHelper.cs:line 18
   at AssetStudio.Object.Dump() in L:\GIT\AssetStudioMod\AssetStudio\Classes\Object.cs:line 48
   at AssetStudioGUI.Studio.DumpAsset(Object obj) in L:\GIT\AssetStudioMod\AssetStudioGUI\Studio.cs:line 913
   at AssetStudioGUI.AssetStudioGUIForm.tabControl2_SelectedIndexChanged(Object sender, EventArgs e) in L:\GIT\AssetStudioMod\AssetStudioGUI\AssetStudioGUIForm.cs:line 1485
   at System.Windows.Forms.TabControl.OnSelectedIndexChanged(EventArgs e)
   at System.Windows.Forms.TabControl.WmSelChange()
   at System.Windows.Forms.TabControl.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

A file packed with the intent of conveying this bug:
fonttest.zip (zipped to make github happy)

Another thing possibly worth changing is that this is currently unhandled by the form and is not output to the Console. Unsure if that is intended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions