From: Michael Stefaniuc mstefani@winehq.org
--- dlls/dmstyle/style.c | 9 ++++++++- include/dmusicf.h | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index 5d2c5ec4ed0..b449a60ea48 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -442,7 +442,14 @@ static HRESULT parse_pref_list(struct style *This, IStream *stream, struct chunk switch (MAKE_IDTYPE(chunk.id, chunk.type)) { case DMUS_FOURCC_PARTREF_CHUNK: - hr = stream_chunk_get_data(stream, &chunk, &part_ref->header, sizeof(part_ref->header)); + if (chunk.size != sizeof(part_ref->header) && + chunk.size != offsetof(DMUS_IO_PARTREF, wPad)) /* DX7 */ + { + WARN("Invalid size of %s\n", debugstr_chunk(&chunk)); + hr = E_FAIL; + break; + } + hr = stream_chunk_get_data(stream, &chunk, &part_ref->header, chunk.size); break;
case MAKE_IDTYPE(FOURCC_LIST, DMUS_FOURCC_UNFO_LIST): diff --git a/include/dmusicf.h b/include/dmusicf.h index 1d61a0c4e12..2f75960954c 100644 --- a/include/dmusicf.h +++ b/include/dmusicf.h @@ -529,8 +529,9 @@ struct _DMUS_IO_PARTREF { BYTE bSubChordLevel; BYTE bPriority; BYTE bRandomVariation; + /* DX8 */ WORD wPad; - DWORD dwPChannel; + DWORD dwPChannel; /* Replaces wLogicalPartID */ };