mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 01:29:41 +01:00
Merge pull request #5059 from raven02/patch-16
Return as ERROR_PSMF_INVALID_ID
This commit is contained in:
commit
ea41e0466b
1 file changed
+11
-6
+11
-6
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user