Fixed endianness issue with precaching of MUS files

This commit is contained in:
alexey.lysiuk 2016-10-01 12:27:24 +03:00 committed by Christoph Oelckers
parent e9ce699042
commit 099bfed806
1 changed files with 2 additions and 2 deletions

View File

@ -211,11 +211,11 @@ bool MUSSong2::CheckDone()
void MUSSong2::Precache() void MUSSong2::Precache()
{ {
TArray<WORD> work(MusHeader->NumInstruments); TArray<WORD> work(LittleShort(MusHeader->NumInstruments));
const BYTE *used = (BYTE *)MusHeader + sizeof(MUSHeader) / sizeof(BYTE); const BYTE *used = (BYTE *)MusHeader + sizeof(MUSHeader) / sizeof(BYTE);
int i, k; int i, k;
for (i = k = 0; i < MusHeader->NumInstruments; ++i) for (i = k = 0; i < LittleShort(MusHeader->NumInstruments); ++i)
{ {
BYTE instr = used[k++]; BYTE instr = used[k++];
WORD val; WORD val;