quartz: Don't call ReleaseSemaphore on NULL semaphore handles
Chris Robinson
chris.kcat at gmail.com
Wed Apr 4 11:27:40 CDT 2007
-------------- next part --------------
From 0a5f7a176a51495d70553886a95b67930fc188d1 Mon Sep 17 00:00:00 2001
From: Chris Robinson <chris.kcat at gmail.com>
Date: Wed, 4 Apr 2007 05:07:31 -0700
Subject: [PATCH] quartz: Don't call ReleaseSemaphore on NULL semaphore handles
---
dlls/quartz/memallocator.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c
index 9167990..3cabe12 100644
--- a/dlls/quartz/memallocator.c
+++ b/dlls/quartz/memallocator.c
@@ -394,7 +394,7 @@ static HRESULT WINAPI BaseMemAllocator_ReleaseBuffer(IMemAllocator * iface, IMed
LeaveCriticalSection(&This->csState);
/* notify a waiting thread that there is now a free buffer */
- if (!ReleaseSemaphore(This->hSemWaiting, 1, NULL))
+ if (This->hSemWaiting && !ReleaseSemaphore(This->hSemWaiting, 1, NULL))
{
ERR("ReleaseSemaphore failed with error %u\n", GetLastError());
hr = HRESULT_FROM_WIN32(GetLastError());
--
1.4.4.4
More information about the wine-patches
mailing list