From 1a987dda26f4cae403cffd2176c08d415555c9f8 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 8 Jun 2013 02:21:21 -0700 Subject: [PATCH] Fix crash in sceKernelGetThreadmanIdType(). --- Core/HLE/sceKernel.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/HLE/sceKernel.h b/Core/HLE/sceKernel.h index 53dde68286..3a6f31ca25 100644 --- a/Core/HLE/sceKernel.h +++ b/Core/HLE/sceKernel.h @@ -493,6 +493,11 @@ public: 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;