Fix a crash when opening an XBE with an invalid TLS structure

This commit is contained in:
Luke Usher 2016-11-26 22:21:44 +00:00
parent 86c3bbf947
commit 08228c30a1
1 changed files with 4 additions and 0 deletions

View File

@ -328,6 +328,10 @@ void EmuInitFS()
// generate fs segment selector
void EmuGenerateFS(Xbe::TLS *pTLS, void *pTLSData)
{
// Make sure the TLS Start and End addresses are within Xbox Memory
if (pTLS->dwDataStartAddr > XBOX_MEMORY_SIZE || pTLS->dwDataEndAddr > XBOX_MEMORY_SIZE) {
return;
}
NT_TIB *OrgNtTib;
xboxkrnl::KPCR *NewPcr;