mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
Fixed crash when vid_setmode CCMD is used from command line
It's impossible to validate video mode at such early stage of initialization Added sanity check for mode's width and height as well https://forum.zdoom.org/viewtopic.php?t=59990
This commit is contained in:
parent
d3cacbf246
commit
2e7d196f8b
1 changed files with 2 additions and 8 deletions
|
@ -1454,7 +1454,6 @@ bool IVideo::SetResolution (int width, int height, int bits)
|
|||
|
||||
CCMD (vid_setmode)
|
||||
{
|
||||
bool goodmode = false;
|
||||
int width = 0, height = SCREENHEIGHT;
|
||||
int bits = DisplayBits;
|
||||
|
||||
|
@ -1471,13 +1470,8 @@ CCMD (vid_setmode)
|
|||
}
|
||||
}
|
||||
|
||||
if (width && I_CheckResolution (width, height, bits))
|
||||
{
|
||||
goodmode = true;
|
||||
}
|
||||
|
||||
if (!fullscreen)
|
||||
goodmode = true;
|
||||
const bool goodmode = (width > 0 && height > 0)
|
||||
&& (!fullscreen || (Video != nullptr && I_CheckResolution(width, height, bits)));
|
||||
|
||||
if (goodmode)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue