Skip to content

Commit

Permalink
Test ply_xwave
Browse files Browse the repository at this point in the history
  • Loading branch information
AreaZR committed Oct 28, 2024
1 parent e45fe13 commit 3bedc38
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/m4a.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3bedc38

Please sign in to comment.