add some validations

This commit is contained in:
Dzmitry Dubrova 2024-08-15 20:22:24 +03:00
parent cec89a3c48
commit 27b7bc72e1

View file

@ -152,10 +152,23 @@ s32 PS4_SYSV_ABI sceVideoOutSubmitFlip(s32 handle, s32 bufferIndex, s32 flipMode
}
int PS4_SYSV_ABI sceVideoOutGetEventId(const Kernel::SceKernelEvent* ev) {
if (ev == nullptr) {
return SCE_VIDEO_OUT_ERROR_INVALID_ADDRESS;
}
if (ev->filter != Kernel::SceKernelEvent::Filter::VideoOut) {
return ORBIS_VIDEO_OUT_ERROR_INVALID_EVENT_QUEUE;
}
return ev->ident;
}
int PS4_SYSV_ABI sceVideoOutGetEventData(const Kernel::SceKernelEvent* ev, int64_t* data) {
if (ev == nullptr || data == nullptr) {
return SCE_VIDEO_OUT_ERROR_INVALID_ADDRESS;
}
if (ev->filter != Kernel::SceKernelEvent::Filter::VideoOut) {
return ORBIS_VIDEO_OUT_ERROR_INVALID_EVENT_QUEUE;
}
*data = ev->data;
return ORBIS_OK;
}