diff --git a/Source/Core/VideoBackends/D3D/FramebufferManager.cpp b/Source/Core/VideoBackends/D3D/FramebufferManager.cpp index 3f7ab4c528..e95b2ab70e 100644 --- a/Source/Core/VideoBackends/D3D/FramebufferManager.cpp +++ b/Source/Core/VideoBackends/D3D/FramebufferManager.cpp @@ -275,8 +275,10 @@ void FramebufferManager::CopyToRealXFB(u32 xfbAddr, u32 fbStride, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma) { u8* dst = Memory::GetPointer(xfbAddr); - // below div2 due to dx using pixel width - s_xfbEncoder.Encode(dst, fbStride / 2, fbHeight, sourceRc, Gamma); + + // The destination stride can differ from the copy region width, in which case the pixels + // outside the copy region should not be written to. + s_xfbEncoder.Encode(dst, static_cast(sourceRc.GetWidth()), fbHeight, sourceRc, Gamma); } std::unique_ptr FramebufferManager::CreateXFBSource(unsigned int target_width,