CaitSith2 / SwitchSDTool

Other
153 stars 18 forks source link

1.08 crash when parsing NCAs #3

Closed Guilhem30 closed 5 years ago

Guilhem30 commented 6 years ago

1.08 crash while 1.07 works fine. It's a generic error so it probably won't be much help but i don't know how to debug .net

System.Runtime.InteropServices.ExternalException (0x80004005): Une erreur générique s'est produite dans GDI+.
   à System.Drawing.Bitmap..ctor(Stream stream)
   à SwitchSDTool.ControlNACP..ctor(Romfs romfs, String baseTitleID) dans H:\DevProjects\SwitchSDTool\SwitchSDTool\ControlNACP.cs:ligne 67
   à SwitchSDTool.Form1.ReadControlInfo(String titleID, CnmtContentEntry entry) dans H:\DevProjects\SwitchSDTool\SwitchSDTool\Form1.cs:ligne 962
   à SwitchSDTool.Form1.btnParseNCA_Click(Object sender, EventArgs e) dans H:\DevProjects\SwitchSDTool\SwitchSDTool\Form1.cs:ligne 1512
   à System.Windows.Forms.Control.OnClick(EventArgs e)
   à System.Windows.Forms.Button.OnClick(EventArgs e)
   à System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   à System.Windows.Forms.Control.WndProc(Message& m)
   à System.Windows.Forms.ButtonBase.WndProc(Message& m)
   à System.Windows.Forms.Button.WndProc(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
EternityShack commented 5 years ago

I am getting the same error with 1.09, but the cause is different. When parsing NCAs, the tool is apparently trying to read information from a null source.

Parameter name: input
   at System.IO.BinaryReader..ctor(Stream input, Encoding encoding, Boolean leaveOpen)
   at LibHac.Pfs..ctor(Stream stream)
   at SwitchSDTool.Form1.btnParseNCA_Click(Object sender, EventArgs e) in H:\DevProjects\SwitchSDTool\SwitchSDTool\Form1.cs:line 1565
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
CaitSith2 commented 5 years ago

Fixed in https://github.com/CaitSith2/SwitchSDTool/releases/tag/1.10