Maarten Lankhorst : quartz: NotifyAllocator does not like a null argument.
Alexandre Julliard
julliard at winehq.org
Mon Apr 28 08:01:22 CDT 2008
Module: wine
Branch: master
Commit: 9e143cdb6323446506444a23caf717477270dc52
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9e143cdb6323446506444a23caf717477270dc52
Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Fri Apr 25 14:14:24 2008 -0700
quartz: NotifyAllocator does not like a null argument.
---
dlls/quartz/pin.c | 13 +++++++++----
dlls/quartz/tests/videorenderer.c | 1 +
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c
index 868f73e..6bbcf9a 100644
--- a/dlls/quartz/pin.c
+++ b/dlls/quartz/pin.c
@@ -759,6 +759,13 @@ HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator *
if (bReadOnly)
FIXME("Read only flag not handled yet!\n");
+ /* FIXME: Should we release the allocator on disconnection? */
+ if (!pAllocator)
+ {
+ WARN("Null allocator\n");
+ return E_POINTER;
+ }
+
if (This->pAllocator)
IMemAllocator_Release(This->pAllocator);
This->pAllocator = pAllocator;
@@ -1187,11 +1194,9 @@ HRESULT OutputPin_DeliverDisconnect(OutputPin * This)
}
else /* Kill the allocator! */
{
- hr = IMemInputPin_NotifyAllocator(This->pMemInputPin, NULL, 0);
- if (SUCCEEDED(hr))
- hr = IPin_Disconnect(This->pin.pConnectedTo);
+ hr = IPin_Disconnect(This->pin.pConnectedTo);
}
-
+ IPin_Disconnect((IPin *)This);
}
LeaveCriticalSection(This->pin.pCritSec);
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c
index 378e019..d18620f 100644
--- a/dlls/quartz/tests/videorenderer.c
+++ b/dlls/quartz/tests/videorenderer.c
@@ -96,6 +96,7 @@ static void test_pin(IPin *pin)
if (mpin)
{
ok(IMemInputPin_ReceiveCanBlock(mpin) == S_OK, "Receive can't block for pin!\n");
+ ok(IMemInputPin_NotifyAllocator(mpin, NULL, 0) == E_POINTER, "NotifyAllocator likes a NULL pointer argument\n");
IMemInputPin_Release(mpin);
}
/* TODO */
More information about the wine-cvs
mailing list