From 05feac3eb09a3898ceb50d465e62ca0d7940c761 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 19 Jan 2015 08:43:43 -0800 Subject: [PATCH] Fix a potential divide by zero. --- GPU/Common/FramebufferCommon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index 5172ea7fe0..2b64aa5ee8 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -611,7 +611,7 @@ void FramebufferManagerCommon::FindTransferFramebuffers(VirtualFramebuffer *&dst } if (match) { srcYOffset = yOffset; - srcXOffset = (byteOffset / bpp) % srcStride; + srcXOffset = srcStride == 0 ? 0 : (byteOffset / bpp) % srcStride; srcBuffer = vfb; } }