radeon_hd: Sanitize connector_is_dp function
* there is no guarentee the data in encoderExternal is valid if we don't check valid == true
This commit is contained in:
@@ -734,11 +734,20 @@ connector_probe()
|
||||
bool
|
||||
connector_is_dp(uint32 connectorIndex)
|
||||
{
|
||||
if (gConnector[connectorIndex]->type == VIDEO_CONNECTOR_DP
|
||||
|| gConnector[connectorIndex]->type == VIDEO_CONNECTOR_EDP
|
||||
|| gConnector[connectorIndex]->encoderExternal.isDPBridge == true) {
|
||||
connector_info* connector = gConnector[connectorIndex];
|
||||
|
||||
// Traditional DisplayPort connector
|
||||
if (connector->type == VIDEO_CONNECTOR_DP
|
||||
|| connector->type == VIDEO_CONNECTOR_EDP) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// DisplayPort bridge on external encoder
|
||||
if (connector->encoderExternal.valid == true
|
||||
&& connector->encoderExternal.isDPBridge == true) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user