From: <sv...@op...> - 2024-06-02 18:19:57
|
Author: sagamusix Date: Sun Jun 2 20:19:50 2024 New Revision: 20911 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20911 Log: [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: trunk/OpenMPT/soundlib/SampleIO.cpp Modified: trunk/OpenMPT/soundlib/SampleIO.cpp ============================================================================== --- trunk/OpenMPT/soundlib/SampleIO.cpp Sun Jun 2 20:19:25 2024 (r20910) +++ trunk/OpenMPT/soundlib/SampleIO.cpp Sun Jun 2 20:19:50 2024 (r20911) @@ -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 { |