Michael Stefaniuc : dmime: Accept a DMUS_IO_SEGMENT_HEADER without rtPlayStart field.

Alexandre Julliard julliard at winehq.org
Wed Nov 3 16:42:02 CDT 2021


Module: wine
Branch: master
Commit: 460ae3d82c2a31d4f34df5203011efb187e807c0
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=460ae3d82c2a31d4f34df5203011efb187e807c0

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed Nov  3 00:54:50 2021 +0100

dmime: Accept a DMUS_IO_SEGMENT_HEADER without rtPlayStart field.

Tron 2.0 has a segment header of 56, so is missing the rtPlayStart field.
Based on a patch by Alistair Leslie-Hughes.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dmime/segment.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/dmime/segment.c b/dlls/dmime/segment.c
index f5dbf4b9959..326ffe98e18 100644
--- a/dlls/dmime/segment.c
+++ b/dlls/dmime/segment.c
@@ -727,7 +727,8 @@ static inline void dump_segment_header(DMUS_IO_SEGMENT_HEADER *h, DWORD size)
     if (dx == 9) {
         TRACE("\trtLoopStart: %s\n", wine_dbgstr_longlong(h->rtLoopStart));
         TRACE("\trtLoopEnd: %s\n", wine_dbgstr_longlong(h->rtLoopEnd));
-        TRACE("\trtPlayStart: %s\n", wine_dbgstr_longlong(h->rtPlayStart));
+        if (size > offsetof(DMUS_IO_SEGMENT_HEADER, rtPlayStart))
+            TRACE("\trtPlayStart: %s\n", wine_dbgstr_longlong(h->rtPlayStart));
     }
 }
 
@@ -742,8 +743,11 @@ static HRESULT parse_segment_form(IDirectMusicSegment8Impl *This, IStream *strea
     while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) {
         switch (chunk.id) {
             case DMUS_FOURCC_SEGMENT_CHUNK:
+                /* DX9 without rtPlayStart field */
+                if (chunk.size == offsetof(DMUS_IO_SEGMENT_HEADER, rtPlayStart))
+                    WARN("Missing rtPlayStart field in %s\n", debugstr_chunk(&chunk));
                 /* DX7, DX8 and DX9 structure sizes */
-                if (chunk.size != offsetof(DMUS_IO_SEGMENT_HEADER, rtLength) &&
+                else if (chunk.size != offsetof(DMUS_IO_SEGMENT_HEADER, rtLength) &&
                         chunk.size != offsetof(DMUS_IO_SEGMENT_HEADER, rtLoopStart) &&
                         chunk.size != sizeof(DMUS_IO_SEGMENT_HEADER)) {
                     WARN("Invalid size of %s\n", debugstr_chunk(&chunk));




More information about the wine-cvs mailing list