Vulkan: Make sure we don't access RAM out of its bounds when populating copy.
Some checks failed
Build Android / build_android (apk) (push) Has been cancelled
Build Android / build_android (libretro) (push) Has been cancelled
Build iOS / build_ios (push) Has been cancelled
Build JavaScript / build_js (push) Has been cancelled
Build Linux / build_linux (push) Has been cancelled
Build Linux ARM32 / build_linux_arm32 (push) Has been cancelled
Build Linux ARM64 / build_linux_arm64 (push) Has been cancelled
Build macOS / build_macos (push) Has been cancelled
Build Windows / build_windows (x86_32, Visual Studio 16 2019, installer32.nsi, win32_msvc2019, Win32) (push) Has been cancelled
Build Windows / build_windows (x86_64, Visual Studio 16 2019, installer64.nsi, win64_msvc2019_64, x64) (push) Has been cancelled
Build Windows Psf / build_windows_psf (off, x86_64, Visual Studio 16 2019, installer64.nsi, x64) (push) Has been cancelled
Build Windows Psf / build_windows_psf (on, x86_64, Visual Studio 16 2019, installer64.nsi, x64) (push) Has been cancelled
Check Format / run_clangformat (push) Has been cancelled

This commit is contained in:
Jean-Philip Desjardins 2025-04-21 10:37:42 -04:00
parent 1e933dafc9
commit 1bd468c7fb

View file

@ -1537,6 +1537,13 @@ void CGSH_Vulkan::ProcessLocalToLocalTransfer()
auto [transferAddress, transferSize] = GsTransfer::GetSrcRange(bltBuf, trxReg, trxPos); auto [transferAddress, transferSize] = GsTransfer::GetSrcRange(bltBuf, trxReg, trxPos);
//Since GetSrcRange returns values in page granularity, it's possible that we obtain an
//[address, size] pair that goes beyond RAM's range. Happens in FF12's intro level.
if((transferAddress + transferSize) > RAMSIZE)
{
transferSize = RAMSIZE - transferAddress;
}
auto commandBuffer = m_frameCommandBuffer->GetCommandBuffer(); auto commandBuffer = m_frameCommandBuffer->GetCommandBuffer();
VkBufferCopy bufferCopy = {}; VkBufferCopy bufferCopy = {};