diff --git a/Core/HLE/sceKernel.h b/Core/HLE/sceKernel.h index 53dde682864e..3a6f31ca25a2 100644 --- a/Core/HLE/sceKernel.h +++ b/Core/HLE/sceKernel.h @@ -493,6 +493,11 @@ class KernelObjectPool { bool GetIDType(SceUID handle, int *type) const { + if (handle < handleOffset || handle >= handleOffset+maxCount || !occupied[handle-handleOffset]) + { + ERROR_LOG(HLE, "Kernel: Bad object handle %i (%08x)", handle, handle); + return false; + } KernelObject *t = pool[handle - handleOffset]; *type = t->GetIDType(); return true;