Skip to content

Commit

Permalink
[wav]fix sound cracking and wave file alloc error
Browse files Browse the repository at this point in the history
  • Loading branch information
jianjunjiang committed Dec 10, 2021
1 parent 4d08c31 commit 4f91ef9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/kernel/sound/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ static inline struct sound_t * sound_alloc_from_xfs_wav(struct xfs_context_t * c
return NULL;
}

header.riffsz = be32_to_cpu(header.riffsz);
header.fmtsz = be32_to_cpu(header.fmtsz);
header.fmttag = be16_to_cpu(header.fmttag);
header.channel = be16_to_cpu(header.channel);
header.samplerate = be32_to_cpu(header.samplerate);
header.byterate = be32_to_cpu(header.byterate);
header.align = be16_to_cpu(header.align);
header.bps = be16_to_cpu(header.bps);
header.datasz = be32_to_cpu(header.datasz);
header.riffsz = le32_to_cpu(header.riffsz);
header.fmtsz = le32_to_cpu(header.fmtsz);
header.fmttag = le16_to_cpu(header.fmttag);
header.channel = le16_to_cpu(header.channel);
header.samplerate = le32_to_cpu(header.samplerate);
header.byterate = le32_to_cpu(header.byterate);
header.align = le16_to_cpu(header.align);
header.bps = le16_to_cpu(header.bps);
header.datasz = le32_to_cpu(header.datasz);

if( (memcmp(header.riff, "RIFF", 4) != 0) ||
(memcmp(header.wave, "WAVE", 4) != 0) ||
Expand Down

0 comments on commit 4f91ef9

Please sign in to comment.