|
From: <sv...@op...> - 2024-06-02 18:21:58
|
Author: sagamusix Date: Sun Jun 2 20:21:51 2024 New Revision: 20916 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20916 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.28/ (props changed) branches/OpenMPT-1.28/soundlib/SampleIO.cpp Modified: branches/OpenMPT-1.28/soundlib/SampleIO.cpp ============================================================================== --- branches/OpenMPT-1.28/soundlib/SampleIO.cpp Sun Jun 2 20:21:34 2024 (r20915) +++ branches/OpenMPT-1.28/soundlib/SampleIO.cpp Sun Jun 2 20:21:51 2024 (r20916) @@ -56,7 +56,7 @@ restrictedSampleDataView = file.GetPinnedRawDataView(CalculateEncodedSize(sample.nLength)); sourceBuf = restrictedSampleDataView.data(); fileSize = restrictedSampleDataView.size(); - if(sourceBuf == nullptr) + if(fileSize < 1) return 0; } else { |