* CID 525: Check the return of _UpdateModeList() as otherwise fModeList can
still be NULL although it is used further down. * CID 526: Check the front buffer to be available before using it in SetMode(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27483 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -498,6 +498,9 @@ AccelerantHWInterface::SetMode(const display_mode& mode)
|
||||
if (!_IsValidMode(mode))
|
||||
return B_BAD_VALUE;
|
||||
|
||||
if (fFrontBuffer == NULL)
|
||||
return B_NO_INIT;
|
||||
|
||||
// just try to set the mode - we let the graphics driver
|
||||
// approve or deny the request, as it should know best
|
||||
|
||||
@@ -822,8 +825,11 @@ AccelerantHWInterface::GetPreferredMode(display_mode* preferredMode)
|
||||
if (version != EDID_VERSION_1)
|
||||
return B_NOT_SUPPORTED;
|
||||
|
||||
if (fModeList == NULL)
|
||||
_UpdateModeList();
|
||||
if (fModeList == NULL) {
|
||||
status = _UpdateModeList();
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
}
|
||||
|
||||
status = B_NOT_SUPPORTED;
|
||||
display_mode bestMode;
|
||||
|
||||
Reference in New Issue
Block a user