mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-11-21 17:45:11 +00:00
Fix off-by-one on audio renderer PerformanceManager.GetNextEntry (#7139)
This commit is contained in:
parent
56b2f84702
commit
d97e995e59
3 changed files with 5 additions and 8 deletions
|
@ -18,16 +18,12 @@ namespace Ryujinx.Audio.Renderer.Server.Performance
|
|||
|
||||
if (version == 2)
|
||||
{
|
||||
return (ulong)PerformanceManagerGeneric<PerformanceFrameHeaderVersion2,
|
||||
PerformanceEntryVersion2,
|
||||
PerformanceDetailVersion2>.GetRequiredBufferSizeForPerformanceMetricsPerFrame(ref parameter);
|
||||
return (ulong)PerformanceManagerGeneric<PerformanceFrameHeaderVersion2, PerformanceEntryVersion2, PerformanceDetailVersion2>.GetRequiredBufferSizeForPerformanceMetricsPerFrame(ref parameter);
|
||||
}
|
||||
|
||||
if (version == 1)
|
||||
{
|
||||
return (ulong)PerformanceManagerGeneric<PerformanceFrameHeaderVersion1,
|
||||
PerformanceEntryVersion1,
|
||||
PerformanceDetailVersion1>.GetRequiredBufferSizeForPerformanceMetricsPerFrame(ref parameter);
|
||||
return (ulong)PerformanceManagerGeneric<PerformanceFrameHeaderVersion1, PerformanceEntryVersion1, PerformanceDetailVersion1>.GetRequiredBufferSizeForPerformanceMetricsPerFrame(ref parameter);
|
||||
}
|
||||
|
||||
throw new NotImplementedException($"Unknown Performance metrics data format version {version}");
|
||||
|
|
|
@ -234,7 +234,7 @@ namespace Ryujinx.Audio.Renderer.Server.Performance
|
|||
{
|
||||
performanceEntry = null;
|
||||
|
||||
if (_entryDetailIndex > MaxFrameDetailCount)
|
||||
if (_entryDetailIndex >= MaxFrameDetailCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ namespace Ryujinx.Audio.Renderer.Server.Performance
|
|||
EntryCountOffset = (uint)CurrentHeader.GetEntryCountOffset(),
|
||||
};
|
||||
|
||||
uint baseEntryOffset = (uint)(Unsafe.SizeOf<THeader>() + GetEntriesSize() + Unsafe.SizeOf<IPerformanceDetailEntry>() * _entryDetailIndex);
|
||||
uint baseEntryOffset = (uint)(Unsafe.SizeOf<THeader>() + GetEntriesSize() + Unsafe.SizeOf<TEntryDetail>() * _entryDetailIndex);
|
||||
|
||||
ref TEntryDetail entryDetail = ref EntriesDetail[_entryDetailIndex];
|
||||
|
||||
|
|
|
@ -9,5 +9,6 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrlGpu.Types
|
|||
public byte Sm0TpcIndex;
|
||||
public byte Sm1GpcIndex;
|
||||
public byte Sm1TpcIndex;
|
||||
public uint Reserved;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue