Author: sagamusix
Date: Sun Jun 2 20:21:34 2024
New Revision: 20915
URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20915
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.29/ (props changed)
branches/OpenMPT-1.29/soundlib/SampleIO.cpp
Modified: branches/OpenMPT-1.29/soundlib/SampleIO.cpp
==============================================================================
--- branches/OpenMPT-1.29/soundlib/SampleIO.cpp Sun Jun 2 20:21:20 2024 (r20914)
+++ branches/OpenMPT-1.29/soundlib/SampleIO.cpp Sun Jun 2 20:21:34 2024 (r20915)
@@ -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
{
|