From: <sv...@op...> - 2024-06-08 14:08:20
|
Author: sagamusix Date: Sat Jun 8 16:08:14 2024 New Revision: 20963 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20963 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.29/ (props changed) branches/OpenMPT-1.29/soundlib/Load_mo3.cpp Modified: branches/OpenMPT-1.29/soundlib/Load_mo3.cpp ============================================================================== --- branches/OpenMPT-1.29/soundlib/Load_mo3.cpp Sat Jun 8 16:07:21 2024 (r20962) +++ branches/OpenMPT-1.29/soundlib/Load_mo3.cpp Sat Jun 8 16:08:14 2024 (r20963) @@ -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) |