Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix possible stack corruption with XM instrument headers claiming a s…
…ize of less than 4

Closes #275
  • Loading branch information
sagamusix committed Jun 26, 2022
1 parent 66c31bf commit 3a5474f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/milkyplay/LoaderXM.cpp
Expand Up @@ -478,7 +478,7 @@ mp_sint32 LoaderXM::load(XMFileBase& f, XModule* module)

f.readDwords(&instr[y].size,1);

if (instr[y].size < 29)
if (instr[y].size >= 4 && instr[y].size < 29)
{
mp_ubyte buffer[29];
memset(buffer, 0, sizeof(buffer));
Expand Down

0 comments on commit 3a5474f

Please sign in to comment.