fix: prevent oob access of sequenceMap (#2123)

Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
briaguya 2022-12-09 02:25:45 -05:00 committed by GitHub
parent 274c12f3cb
commit 408143ec8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -486,7 +486,7 @@ u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts) {
return NULL; return NULL;
u16 newSeqId = SfxEditor_GetReplacementSeq(seqId); u16 newSeqId = SfxEditor_GetReplacementSeq(seqId);
if (!sequenceMap[newSeqId]){ if (newSeqId > MAX_SEQUENCES || !sequenceMap[newSeqId]) {
return NULL; return NULL;
} }
SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[newSeqId]); SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[newSeqId]);