From 8517fbe761918aa856d3cf330abcc9145e24fe1d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 16 Nov 2012 01:41:54 -0800 Subject: [PATCH] PollSema: don't allow values <= 0. --- Core/HLE/sceKernelSemaphore.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core/HLE/sceKernelSemaphore.cpp b/Core/HLE/sceKernelSemaphore.cpp index 30c210f0a0..e287d1b3f9 100644 --- a/Core/HLE/sceKernelSemaphore.cpp +++ b/Core/HLE/sceKernelSemaphore.cpp @@ -290,6 +290,9 @@ int sceKernelPollSema(SceUID id, int wantedCount) { DEBUG_LOG(HLE,"sceKernelPollSema(%i, %i)", id, wantedCount); + if (wantedCount <= 0) + return SCE_KERNEL_ERROR_ILLEGAL_COUNT; + u32 error; Semaphore *s = kernelObjects.Get(id, error); if (s)