GUI: Game Options crashes launcher at small application widths
|Reported by:||antoniou79||Owned by:||antoniou79|
|Version:||Keywords:||crash, assertion fault, width, resize|
Tested on Windows 10 x64 (Version 10.0.19044 Build 19044, all updates) built from latest master (HEAD).
Steps to reproduce:
- Launch ScummVM in windowed mode
- From the launcher select any game from the list
- Click on "Game Options..." (former "Edit Game...") button.
- When the dialogue opens, try to resize the ScummVM's window borders so as to reduce the window's width to a very small size. (see attached screenshot for example)
ScummVM crashes with the message:
Assertion failed: isValidRect(), file ./common/rect.h, line 160
ScummVM should handle this without crashing.
The crash does not occur for the launcher's "Global Options...", so it seems to be specific to the "Game Options..." dialogue.
If the width of the launcher is already small when launching ScummVM, then the crash will occur immediately upon clicking on "Game Options..."
A quick debugging session with VS indicates that the fault lies somewhere in ScrollContainerWidget::reflowLayout() in gui\widgets\scrollcontainer.cpp during the loop of "reflow layout of inner widgets"
From the related discussion on Discord, it seems that the issue has been around for a while (quite possibly since 2.2.0, according to rootfather)