From ea85c5b15b7c2eedcae389613f2b03f34fc803bf Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Sat, 23 Feb 2008 08:40:25 +0000 Subject: [PATCH] dmband: Assign to struct instead of using memcpy. --- dlls/dmband/bandtrack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/dmband/bandtrack.c b/dlls/dmband/bandtrack.c index f85d09694fc..b328b1d1c40 100644 --- a/dlls/dmband/bandtrack.c +++ b/dlls/dmband/bandtrack.c @@ -302,7 +302,7 @@ static HRESULT IDirectMusicBandTrack_IPersistStream_LoadBand (LPPERSISTSTREAM if ERR(": no more memory\n"); return E_OUTOFMEMORY; } - memcpy(&pNewBand->BandHeader, pHeader, sizeof(DMUS_PRIVATE_BAND_ITEM_HEADER)); + pNewBand->BandHeader = *pHeader; pNewBand->pBand = (IDirectMusicBandImpl*)((char*)(*ppBand) - offsetof(IDirectMusicBandImpl,BandVtbl)); IDirectMusicBand_AddRef(*ppBand); list_add_tail (&This->Bands, &pNewBand->entry); @@ -322,6 +322,8 @@ static HRESULT IDirectMusicBandTrack_IPersistStream_ParseBandsList (LPPERSISTSTR IDirectMusicBand* pBand = NULL; DMUS_PRIVATE_BAND_ITEM_HEADER header; + memset(&header, 0, sizeof header); + if (pChunk->fccID != DMUS_FOURCC_BANDS_LIST) { ERR_(dmfile)(": %s chunk should be a BANDS list\n", debugstr_fourcc (pChunk->fccID)); return E_FAIL;