[PATCH 2/2] dmime: Skip Segment header only if too much data
Michael Stefaniuc
mstefani at winehq.org
Tue Nov 2 19:13:07 CDT 2021
Hello Alistair,
I have submitted a different patch that accepts DMUS_IO_SEGMENT_HEADER without
rtPlayStart field but warns about it.
Really puzzling what was used to create those .sgt files included in Sound.rez.
bye
michael
On 11/1/21 07:30, Alistair Leslie-Hughes wrote:
> Tron 2.0 has a segment header of 56, so is missing the rtPlayStart field.
>
> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
> ---
> dlls/dmime/segment.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/dlls/dmime/segment.c b/dlls/dmime/segment.c
> index f5dbf4b9959..67522c0edb6 100644
> --- a/dlls/dmime/segment.c
> +++ b/dlls/dmime/segment.c
> @@ -743,9 +743,7 @@ static HRESULT parse_segment_form(IDirectMusicSegment8Impl *This, IStream *strea
> switch (chunk.id) {
> case DMUS_FOURCC_SEGMENT_CHUNK:
> /* DX7, DX8 and DX9 structure sizes */
> - if (chunk.size != offsetof(DMUS_IO_SEGMENT_HEADER, rtLength) &&
> - chunk.size != offsetof(DMUS_IO_SEGMENT_HEADER, rtLoopStart) &&
> - chunk.size != sizeof(DMUS_IO_SEGMENT_HEADER)) {
> + if (chunk.size > sizeof(DMUS_IO_SEGMENT_HEADER)) {
> WARN("Invalid size of %s\n", debugstr_chunk(&chunk));
> break;
> }
>
More information about the wine-devel
mailing list