[PATCH] dmime: Actually get a pCLSID stream before using it (Coverity)

Marcus Meissner marcus at jet.franken.de
Thu Dec 10 17:04:40 CST 2009


Hi,

The code did never get a pCLSIDStream probably due to a copy
and paste error. So get it like some other functions do.

Ciao, Marcus
---
 dlls/dmime/segment.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/dmime/segment.c b/dlls/dmime/segment.c
index 64cb10a..ca127d7 100644
--- a/dlls/dmime/segment.c
+++ b/dlls/dmime/segment.c
@@ -359,6 +359,12 @@ static HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicSegment8_GetParam (LP
     LIST_FOR_EACH (pEntry, &This->Tracks) {
       pIt = LIST_ENTRY(pEntry, DMUS_PRIVATE_SEGMENT_TRACK, entry);
 
+      hr = IDirectMusicTrack_QueryInterface(pIt->pTrack, &IID_IPersistStream, (void**) &pCLSIDStream);
+      if (FAILED(hr)) {
+	ERR("(%p): object %p don't implement IPersistStream Interface. Expect a crash (critical problem)\n", This, pIt->pTrack);
+	continue ;
+      }
+
       TRACE(" - %p -> 0x%x,%p\n", pIt, pIt->dwGroupBits, pIt->pTrack);
 
       if (0xFFFFFFFF != dwGroupBits && 0 == (pIt->dwGroupBits & dwGroupBits)) continue ;
-- 
1.5.6



More information about the wine-patches mailing list