Chris Robinson : quartz: Don' t call ReleaseSemaphore on NULL semaphore handles.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 4 15:40:07 CDT 2007


Module: wine
Branch: master
Commit: 9d41c2e694760e34becadae0d8df34d59db8c7c1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9d41c2e694760e34becadae0d8df34d59db8c7c1

Author: Chris Robinson <chris.kcat at gmail.com>
Date:   Wed Apr  4 05:07:31 2007 -0700

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());




More information about the wine-cvs mailing list