Commit c8e493cb authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dmime: Don't crash when DMSegment loads a MIDI file.

parent 235f6da8
...@@ -790,10 +790,16 @@ static HRESULT WINAPI seg_IPersistStream_Load(IPersistStream *iface, IStream *st ...@@ -790,10 +790,16 @@ static HRESULT WINAPI seg_IPersistStream_Load(IPersistStream *iface, IStream *st
if (!stream) if (!stream)
return E_POINTER; return E_POINTER;
if (stream_get_chunk(stream, &riff) != S_OK || riff.id != FOURCC_RIFF) if (stream_get_chunk(stream, &riff) != S_OK ||
(riff.id != FOURCC_RIFF && riff.id != mmioFOURCC('M','T','h','d')))
return DMUS_E_UNSUPPORTED_STREAM; return DMUS_E_UNSUPPORTED_STREAM;
stream_reset_chunk_start(stream, &riff); stream_reset_chunk_start(stream, &riff);
if (riff.id == mmioFOURCC('M','T','h','d')) {
FIXME("MIDI file loading not supported\n");
return S_OK;
}
hr = IDirectMusicObject_ParseDescriptor(&This->dmobj.IDirectMusicObject_iface, stream, hr = IDirectMusicObject_ParseDescriptor(&This->dmobj.IDirectMusicObject_iface, stream,
&This->dmobj.desc); &This->dmobj.desc);
if (FAILED(hr)) if (FAILED(hr))
......
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