Check if the game's ID is valid before accessing it to set the ntsc u/j register. Prevents discs without a real ID from crashing dolphin.

This commit is contained in:
Shawn Hoffman 2012-03-19 11:12:40 -07:00
parent ff6023df27
commit cf52029b51
1 changed files with 3 additions and 1 deletions

View File

@ -227,7 +227,9 @@ bool CBoot::BootUp()
// setup the map from ISOFile ID
VolumeHandler::SetVolumeName(_StartupPara.m_strFilename);
VideoInterface::SetRegionReg((char)VolumeHandler::GetVolume()->GetUniqueID().at(3));
std::string unique_id = VolumeHandler::GetVolume()->GetUniqueID();
if (unique_id.size() >= 3)
VideoInterface::SetRegionReg(unique_id.at(3));
DVDInterface::SetDiscInside(VolumeHandler::IsValid());