Commit 2cf69bb5 authored by Myah Caron's avatar Myah Caron Committed by Alexandre Julliard

dmband: Avoid cloning stream in parse_bands_list.

A stream that doesn't implement ::Clone can be passed, causing IStream_Seek to crash. Signed-off-by: 's avatarMyah Caron <qsniyg@protonmail.com> Signed-off-by: 's avatarMichael Stefaniuc <mstefani@winehq.org> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d28c7938
......@@ -425,21 +425,22 @@ static HRESULT parse_bands_list(IDirectMusicBandTrack *This, DMUS_PRIVATE_CHUNK
StreamSize = Chunk.dwSize - sizeof(FOURCC);
switch (Chunk.fccID) {
case DMUS_FOURCC_BAND_FORM: {
LPSTREAM pClonedStream = NULL;
ULARGE_INTEGER liOrigPos;
TRACE_(dmfile)(": BAND RIFF\n");
IStream_Clone (pStm, &pClonedStream);
liMove.QuadPart = 0;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, &liOrigPos);
liMove.QuadPart -= sizeof(FOURCC) + (sizeof(FOURCC)+sizeof(DWORD));
IStream_Seek (pClonedStream, liMove, STREAM_SEEK_CUR, NULL);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
hr = load_band(This, pClonedStream, &pBand, &header);
hr = load_band(This, pStm, &pBand, &header);
if (FAILED(hr)) {
ERR(": could not load track\n");
return hr;
}
IStream_Release (pClonedStream);
liMove.QuadPart = (LONGLONG)liOrigPos.QuadPart;
IStream_Seek (pStm, liMove, STREAM_SEEK_SET, NULL);
IDirectMusicTrack_Release(pBand); pBand = NULL; /* now we can release at as it inserted */
......
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