Module: wine Branch: master Commit: 5ea119a3d0c1f823f2ee0be7f40b465f772e73ca URL: http://source.winehq.org/git/wine.git/?a=commit;h=5ea119a3d0c1f823f2ee0be7f4...
Author: Nikolay Sivov bunglehead@gmail.com Date: Tue Jan 27 04:05:00 2009 +0300
quartz: Fix NULL pointer dereference (Coverity).
---
dlls/quartz/control.c | 4 ++-- dlls/quartz/tests/filtergraph.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/control.c b/dlls/quartz/control.c index 36a610e..d14e221 100644 --- a/dlls/quartz/control.c +++ b/dlls/quartz/control.c @@ -591,9 +591,9 @@ HRESULT WINAPI MediaSeekingImpl_SetPositions(IMediaSeeking * iface, LONGLONG * p This->llCurrent = llNewCurrent; This->llStop = llNewStop;
- if (dwCurrentFlags & AM_SEEKING_ReturnTime) + if (pCurrent && (dwCurrentFlags & AM_SEEKING_ReturnTime)) *pCurrent = llNewCurrent; - if (dwStopFlags & AM_SEEKING_ReturnTime) + if (pStop && (dwStopFlags & AM_SEEKING_ReturnTime)) *pStop = llNewStop;
ForwardCmdSeek(This->crst, This->pUserData, fwd_setposition, &args); diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 6f9e4c8..2e5fdc4 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -272,6 +272,11 @@ static void test_mediacontrol(void) ok(hr == S_OK, "GetCurrentPosition failed: %08x\n", hr); ok(pos == 0, "Position != 0 (%x%08x)\n", (DWORD)(pos >> 32), (DWORD)pos);
+ hr = IMediaSeeking_SetPositions(seeking, NULL, AM_SEEKING_ReturnTime, NULL, AM_SEEKING_NoPositioning); + ok(hr == S_OK, "SetPositions failed: %08x\n", hr); + hr = IMediaSeeking_SetPositions(seeking, NULL, AM_SEEKING_NoPositioning, NULL, AM_SEEKING_ReturnTime); + ok(hr == S_OK, "SetPositions failed: %08x\n", hr); + IMediaFilter_SetSyncSource(filter, NULL); pos = 0xdeadbeef; hr = IMediaSeeking_GetCurrentPosition(seeking, &pos);