[06ad607] Crash when selecting Option Search

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
vsonnier
Posts: 80
Joined: Wed Apr 10, 2019 11:22 pm
Graphics Processor: nVidia with Vulkan support
Contact:

[06ad607] Crash when selecting Option Search

Post by vsonnier »

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

Code: Select all

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 ?
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3210
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: [06ad607] Crash when selecting Option Search

Post by drfrag »

It crashes since "add empty line after standard options".
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [06ad607] Crash when selecting Option Search

Post by Graf Zahl »

Oops. Here goes today's release...
User avatar
3saster
Posts: 199
Joined: Fri May 11, 2018 2:39 pm
Location: Canada

Re: [06ad607] Crash when selecting Option Search

Post by 3saster »

Seems a simple size check fixes it:

Code: Select all

		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)
				{
					mDesc.mItems.Pop();
				}
			}
		}
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: [06ad607] Crash when selecting Option Search

Post by _mental_ »

Fixed in 526a576.
Post Reply

Return to “Closed Bugs [GZDoom]”