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

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;