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:
@@ -219,7 +219,9 @@ wxVideoMode wxXF86VidMode_GetCurrentMode(Display* display, int nScreen)
|
|||||||
{
|
{
|
||||||
XF86VidModeModeLine VM;
|
XF86VidModeModeLine VM;
|
||||||
int nDotClock;
|
int nDotClock;
|
||||||
XF86VidModeGetModeLine(display, nScreen, &nDotClock, &VM);
|
if ( !XF86VidModeGetModeLine(display, nScreen, &nDotClock, &VM) )
|
||||||
|
return wxVideoMode();
|
||||||
|
|
||||||
wxClearXVM(VM);
|
wxClearXVM(VM);
|
||||||
return wxCVM2(VM, nDotClock, display, nScreen);
|
return wxCVM2(VM, nDotClock, display, nScreen);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user