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:
Alexander von Gluck IV
2012-03-15 19:14:43 -05:00
parent fd1d8a6031
commit f2d6b9af3a
@@ -734,11 +734,20 @@ connector_probe()
bool bool
connector_is_dp(uint32 connectorIndex) connector_is_dp(uint32 connectorIndex)
{ {
if (gConnector[connectorIndex]->type == VIDEO_CONNECTOR_DP connector_info* connector = gConnector[connectorIndex];
|| gConnector[connectorIndex]->type == VIDEO_CONNECTOR_EDP
|| gConnector[connectorIndex]->encoderExternal.isDPBridge == true) { // Traditional DisplayPort connector
if (connector->type == VIDEO_CONNECTOR_DP
|| connector->type == VIDEO_CONNECTOR_EDP) {
return true; return true;
} }
// DisplayPort bridge on external encoder
if (connector->encoderExternal.valid == true
&& connector->encoderExternal.isDPBridge == true) {
return true;
}
return false; return false;
} }