危房 is formed by combining the character 危, meaning 'dangerous,' with 房, meaning 'house' or 'building,' where 危 directly modifies 房 to specify a building that is unsafe.