Don't crash in wxDisplay::GetCurrentMode() if there is no support

Display sample crashed on startup if XFree86-VidModeExtension extension was
not available.

Add missing error checking to avoid this.
This commit is contained in:
Vadim Zeitlin
2016-05-19 23:52:27 +02:00
parent 596399f2ec
commit 4c09d12a91

View File

@@ -219,7 +219,9 @@ wxVideoMode wxXF86VidMode_GetCurrentMode(Display* display, int nScreen)
{
XF86VidModeModeLine VM;
int nDotClock;
XF86VidModeGetModeLine(display, nScreen, &nDotClock, &VM);
if ( !XF86VidModeGetModeLine(display, nScreen, &nDotClock, &VM) )
return wxVideoMode();
wxClearXVM(VM);
return wxCVM2(VM, nDotClock, display, nScreen);
}