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
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;
}