mirror of
https://github.com/libretro/ppsspp.git
synced 2025-01-25 10:37:52 +00:00
Check EPMap and return ERROR_PSMF_NOT_FOUND if empty
This commit is contained in:
parent
5c41dd6f1e
commit
c2e6f77a2f
@ -750,9 +750,15 @@ u32 scePsmfGetCurrentStreamNumber(u32 psmfStruct)
|
||||
return psmf->currentStreamNum;
|
||||
}
|
||||
|
||||
u32 scePsmfCheckEPMap(u32 psmfPlayer)
|
||||
u32 scePsmfCheckEPMap(u32 psmfStruct)
|
||||
{
|
||||
INFO_LOG(ME, "scePsmfCheckEPMap(%08x)", psmfPlayer);
|
||||
Psmf *psmf = getPsmf(psmfStruct);
|
||||
if (!psmf) {
|
||||
ERROR_LOG(ME, "scePsmfCheckEPMap(%08x): invalid psmf", psmfStruct);
|
||||
return ERROR_PSMF_NOT_FOUND;
|
||||
}
|
||||
|
||||
DEBUG_LOG(ME, "scePsmfCheckEPMap(%08x)", psmfStruct);
|
||||
return 0; // Should be okay according to JPCSP
|
||||
}
|
||||
|
||||
@ -810,6 +816,11 @@ u32 scePsmfGetEPidWithTimestamp(u32 psmfStruct, u32 ts)
|
||||
}
|
||||
DEBUG_LOG(ME, "scePsmfGetEPidWithTimestamp(%08x, %i)", psmfStruct, ts);
|
||||
|
||||
if (psmf->EPMap.empty()) {
|
||||
ERROR_LOG(ME, "scePsmfGetEPidWithTimestamp(%08x): EPMap is empty", psmfStruct);
|
||||
return ERROR_PSMF_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (ts < psmf->presentationStartTime) {
|
||||
ERROR_LOG(ME, "scePsmfGetEPidWithTimestamp(%08x, %i): invalid timestamp", psmfStruct, ts);
|
||||
return ERROR_PSMF_INVALID_TIMESTAMP;
|
||||
@ -820,6 +831,7 @@ u32 scePsmfGetEPidWithTimestamp(u32 psmfStruct, u32 ts)
|
||||
ERROR_LOG(ME, "scePsmfGetEPidWithTimestamp(%08x, %i): invalid id", psmfStruct, epid);
|
||||
return ERROR_PSMF_INVALID_ID;
|
||||
}
|
||||
|
||||
return epid;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user