From 3bedc383a4af237a1b2bee7a31df250497bc76bf Mon Sep 17 00:00:00 2001 From: Rose <83477269+AreaZR@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:16:10 -0400 Subject: [PATCH] Test ply_xwave --- src/m4a.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/m4a.c b/src/m4a.c index 9caedd34a061..c1514e3bd1e1 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -1523,18 +1523,14 @@ void ply_xxx(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) void ply_xwave(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track) { - u32 wav; + union { u8 *a; u8 d[4]; } u; -#ifdef UBFIX - wav = 0; -#endif - - READ_XCMD_BYTE(wav, 0) // UB: uninitialized variable - READ_XCMD_BYTE(wav, 1) - READ_XCMD_BYTE(wav, 2) - READ_XCMD_BYTE(wav, 3) + u.d[0] = *(track->cmdPtr + 0); + u.d[1] = *(track->cmdPtr + 1); + u.d[2] = *(track->cmdPtr + 2); + u.d[3] = *(track->cmdPtr + 3); - track->tone.wav = (struct WaveData *)wav; + track->tone.wav = (struct WaveData *)u.a; track->cmdPtr += 4; }