From 41089ca2841d76554599c71dd4eab21f7d2f4a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 1 Nov 2017 14:43:00 +0100 Subject: [PATCH] Small fix for a bad block transfer in Soul Calibur --- GPU/Common/FramebufferCommon.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index 1f4eb712b1..d0c9efdc27 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -2000,6 +2000,10 @@ void FramebufferManagerCommon::PackFramebufferSync_(VirtualFramebuffer *vfb, int } void FramebufferManagerCommon::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool sync, int x, int y, int w, int h) { + // Clamp to width. Sometimes block transfers can cause this to hit. + if (x + w >= vfb->width) { + w = vfb->width - x; + } if (vfb) { // We'll pseudo-blit framebuffers here to get a resized version of vfb. OptimizeDownloadRange(vfb, x, y, w, h);