From: <sv...@op...> - 2024-06-08 14:07:32
|
Author: sagamusix Date: Sat Jun 8 16:07:21 2024 New Revision: 20962 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20962 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.30/ (props changed) branches/OpenMPT-1.30/soundlib/Load_mo3.cpp Modified: branches/OpenMPT-1.30/soundlib/Load_mo3.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/Load_mo3.cpp Sat Jun 8 16:05:17 2024 (r20961) +++ branches/OpenMPT-1.30/soundlib/Load_mo3.cpp Sat Jun 8 16:07:21 2024 (r20962) @@ -1360,6 +1360,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) |