mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #5059 from raven02/patch-16
Return as ERROR_PSMF_INVALID_ID
This commit is contained in:
commit
ea41e0466b
1 changed files with 11 additions and 6 deletions
|
@ -764,9 +764,10 @@ u32 scePsmfGetEPWithId(u32 psmfStruct, int epid, u32 entryAddr)
|
|||
return ERROR_PSMF_NOT_FOUND;
|
||||
}
|
||||
DEBUG_LOG(ME, "scePsmfGetEPWithId(%08x, %i, %08x)", psmfStruct, epid, entryAddr);
|
||||
|
||||
if (epid < 0 || epid >= (int)psmf->EPMap.size()) {
|
||||
// TODO: Just a guess.
|
||||
return ERROR_PSMF_INVALID_TIMESTAMP;
|
||||
ERROR_LOG(ME, "scePsmfGetEPidWithTimestamp(%08x, %i): invalid id", psmfStruct, epid);
|
||||
return ERROR_PSMF_INVALID_ID;
|
||||
}
|
||||
if (Memory::IsValidAddress(entryAddr)) {
|
||||
Memory::WriteStruct(entryAddr, &psmf->EPMap[epid]);
|
||||
|
@ -782,14 +783,16 @@ u32 scePsmfGetEPWithTimestamp(u32 psmfStruct, u32 ts, u32 entryAddr)
|
|||
return ERROR_PSMF_NOT_FOUND;
|
||||
}
|
||||
DEBUG_LOG(ME, "scePsmfGetEPWithTimestamp(%08x, %i, %08x)", psmfStruct, ts, entryAddr);
|
||||
|
||||
if (ts < psmf->presentationStartTime) {
|
||||
ERROR_LOG(ME, "scePsmfGetEPidWithTimestamp(%08x, %i): invalid timestamp", psmfStruct, ts);
|
||||
return ERROR_PSMF_INVALID_TIMESTAMP;
|
||||
}
|
||||
|
||||
int epid = psmf->FindEPWithTimestamp(ts);
|
||||
if (epid < 0 || epid >= (int)psmf->EPMap.size()) {
|
||||
// TODO: Just a guess.
|
||||
return ERROR_PSMF_INVALID_TIMESTAMP;
|
||||
ERROR_LOG(ME, "scePsmfGetEPidWithTimestamp(%08x, %i): invalid id", psmfStruct, epid);
|
||||
return ERROR_PSMF_INVALID_ID;
|
||||
}
|
||||
|
||||
if (Memory::IsValidAddress(entryAddr)) {
|
||||
|
@ -806,14 +809,16 @@ u32 scePsmfGetEPidWithTimestamp(u32 psmfStruct, u32 ts)
|
|||
return ERROR_PSMF_NOT_FOUND;
|
||||
}
|
||||
DEBUG_LOG(ME, "scePsmfGetEPidWithTimestamp(%08x, %i)", psmfStruct, ts);
|
||||
|
||||
if (ts < psmf->presentationStartTime) {
|
||||
ERROR_LOG(ME, "scePsmfGetEPidWithTimestamp(%08x, %i): invalid timestamp", psmfStruct, ts);
|
||||
return ERROR_PSMF_INVALID_TIMESTAMP;
|
||||
}
|
||||
|
||||
int epid = psmf->FindEPWithTimestamp(ts);
|
||||
if (epid < 0 || epid >= (int)psmf->EPMap.size()) {
|
||||
// TODO: Just a guess.
|
||||
return ERROR_PSMF_INVALID_TIMESTAMP;
|
||||
ERROR_LOG(ME, "scePsmfGetEPidWithTimestamp(%08x, %i): invalid id", psmfStruct, epid);
|
||||
return ERROR_PSMF_INVALID_ID;
|
||||
}
|
||||
return epid;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue