From: <sv...@op...> - 2024-06-08 14:05:28
|
Author: sagamusix Date: Sat Jun 8 16:05:17 2024 New Revision: 20961 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20961 Log: Merged revision(s) 20960 from trunk/OpenMPT: [Fix] MO3: Don't try to load comrpessed samples if the header says that it's a 0-length sample anyway. This may cause a sample buffer to be allocated and its size be reduced to 0, which is an API violation (see assertion in ModSample::HasSampleData()). Found with afl++. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_mo3.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_mo3.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_mo3.cpp Sat Jun 8 15:59:29 2024 (r20960) +++ branches/OpenMPT-1.31/soundlib/Load_mo3.cpp Sat Jun 8 16:05:17 2024 (r20961) @@ -1324,6 +1324,8 @@ sample.uFlags.set(CHN_STEREO); FileReader sampleData = file.ReadChunk(smpHeader.compressedSize); + if(!smpHeader.length) + continue; const uint8 numChannels = sample.GetNumChannels(); if(compression == MO3Sample::smpDeltaCompression || compression == MO3Sample::smpDeltaPrediction) |