Commit 3ce650bf authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

dmime: Added missing NULL ptr check (Coverity).

parent e7d58bdd
...@@ -274,7 +274,7 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegment (LPPERSIS ...@@ -274,7 +274,7 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegment (LPPERSIS
TRACE_(dmfile)(": segment item chunk\n"); TRACE_(dmfile)(": segment item chunk\n");
/** alloc new item entry */ /** alloc new item entry */
pNewItem = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_SEGMENT_ITEM)); pNewItem = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_SEGMENT_ITEM));
if (NULL == pNewItem) { if (!pNewItem) {
ERR(": no more memory\n"); ERR(": no more memory\n");
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -288,6 +288,10 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegment (LPPERSIS ...@@ -288,6 +288,10 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegment (LPPERSIS
} }
case DMUS_FOURCC_SEGMENTITEMNAME_CHUNK: { case DMUS_FOURCC_SEGMENTITEMNAME_CHUNK: {
TRACE_(dmfile)(": segment item name chunk\n"); TRACE_(dmfile)(": segment item name chunk\n");
if (!pNewItem) {
ERR(": pNewItem not allocated, bad chunk order?\n");
return E_FAIL;
}
IStream_Read (pStm, pNewItem->wszName, Chunk.dwSize, NULL); IStream_Read (pStm, pNewItem->wszName, Chunk.dwSize, NULL);
TRACE_(dmfile)(" - name: %s\n", debugstr_w(pNewItem->wszName)); TRACE_(dmfile)(" - name: %s\n", debugstr_w(pNewItem->wszName));
break; break;
...@@ -305,6 +309,10 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegment (LPPERSIS ...@@ -305,6 +309,10 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegment (LPPERSIS
ERR(": could not load Reference\n"); ERR(": could not load Reference\n");
return hr; return hr;
} }
if (!pNewItem) {
ERR(": pNewItem not allocated, bad chunk order?\n");
return E_FAIL;
}
pNewItem->pObject = pObject; pNewItem->pObject = pObject;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment