From: Michael Stefaniuc mstefani@winehq.org
Not documented in the official headers. --- dlls/dmstyle/style.c | 9 ++++++++- include/dmusicf.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index 5ae41198643..5d2c5ec4ed0 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -559,7 +559,14 @@ static HRESULT parse_pttn_list(struct style *This, IStream *stream, struct chunk break;
case DMUS_FOURCC_PATTERN_CHUNK: - hr = stream_chunk_get_data(stream, &chunk, &pattern->pattern, sizeof(pattern->pattern)); + if (chunk.size != sizeof(pattern->pattern) && + chunk.size != offsetof(DMUS_IO_PATTERN, bDestGrooveBottom)) /* DX7 */ + { + WARN("Invalid size of %s\n", debugstr_chunk(&chunk)); + hr = E_FAIL; + break; + } + hr = stream_chunk_get_data(stream, &chunk, &pattern->pattern, chunk.size); break;
case DMUS_FOURCC_RHYTHM_CHUNK: diff --git a/include/dmusicf.h b/include/dmusicf.h index 24b8c585bfe..1d61a0c4e12 100644 --- a/include/dmusicf.h +++ b/include/dmusicf.h @@ -503,6 +503,7 @@ struct _DMUS_IO_PATTERN { BYTE bGrooveTop; WORD wEmbellishment; WORD wNbrMeasures; + /* DX8 */ BYTE bDestGrooveBottom; BYTE bDestGrooveTop; DWORD dwFlags;