From: <sv...@op...> - 2024-06-02 18:21:26
|
Author: sagamusix Date: Sun Jun 2 20:21:20 2024 New Revision: 20914 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20914 Log: Merged revision(s) 20911 from trunk/OpenMPT: [Fix] SampleIO: Not all pinned view implementations were consistent in whether they return a nullptr or not when trying to read data at the end of the file; instead check if the memory size is 0, which must always be the case in such a situation. ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/soundlib/SampleIO.cpp Modified: branches/OpenMPT-1.30/soundlib/SampleIO.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/SampleIO.cpp Sun Jun 2 20:21:05 2024 (r20913) +++ branches/OpenMPT-1.30/soundlib/SampleIO.cpp Sun Jun 2 20:21:20 2024 (r20914) @@ -56,7 +56,7 @@ restrictedSampleDataView = file.GetPinnedView(CalculateEncodedSize(sample.nLength)); sourceBuf = restrictedSampleDataView.data(); fileSize = restrictedSampleDataView.size(); - if(sourceBuf == nullptr) + if(fileSize < 1) return 0; } else { |