[Fixed] [06ad607] Crash when selecting Option Search

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

[06ad607] Crash when selecting Option Search

Postby vsonnier » Sat Sep 07, 2019 12:43 pm

When I select Option Search in the latest GZDoom master, I got a wonderful crash like:

Code: Select allExpand view
VM execution aborted: array access out of bounds. Negative current index = -1

Called from OptionMenu.Init at gzdoom.pk3:zscript/ui/menu/optionmenu.zs, line 110
Called from os_Menu.Init at gzdoom.pk3:zscript/ui/menu/search/menu.zs, line 13
Called from OptionMenuItemSubmenu.Activate at gzdoom.pk3:zscript/ui/menu/optionmenuitems.zs, line 126
Called from OptionMenu.MenuEvent at gzdoom.pk3:zscript/ui/menu/optionmenu.zs, line 349
Called from Menu.SetMenu [Native]

Has anyone else got this ?
Joined: 11 Apr 2019
Github ID: vsonnier
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [06ad607] Crash when selecting Option Search

Postby drfrag » Sat Sep 07, 2019 1:07 pm

It crashes since "add empty line after standard options".
User avatar
I.R developer, I.R smart
Vintage GZDoom Developer
Joined: 23 Apr 2004
Location: Spain

Re: [06ad607] Crash when selecting Option Search

Postby Graf Zahl » Sat Sep 07, 2019 1:09 pm

Oops. Here goes today's release...
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
Joined: 19 Jul 2003
Location: Germany

Re: [06ad607] Crash when selecting Option Search

Postby 3saster » Sat Sep 07, 2019 2:52 pm

Seems a simple size check fixes it:
Code: Select allExpand view
      if(mDesc.mItems.size() > 0)
         let last = mDesc.mItems[mDesc.mItems.size() - 1];
         bool lastIsText = (last is "OptionMenuItemStaticText");
         if (lastIsText)
            String text = last.mLabel;
            bool lastIsSpace = (text == "" || text == " ");
            if (lastIsSpace)
User avatar
Joined: 11 May 2018
Location: Canada

Re: [06ad607] Crash when selecting Option Search

Postby _mental_ » Sun Sep 08, 2019 12:53 am

Fixed in 526a576.
Joined: 07 Aug 2011

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests