diff options
| author | JMC47 <JMC4789@gmail.com> | 2021-09-16 21:04:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-16 21:04:03 -0400 |
| commit | 2d1ec6332b6335107e4e1fbd9c6735840117623e (patch) | |
| tree | 6b2a0c7aaad751a3fccb451ad360feb922fb4b41 /Source/Core/VideoCommon/BPStructs.cpp | |
| parent | a0f7e3110da16b4835cf9de5c34507c5b5b40504 (diff) | |
| parent | 7c7609f5b94e681bce278b1bc0259c7243828377 (diff) | |
Merge pull request #10106 from phire/fix-negative-efb-copies
BPStructs: Ignore malformed efb copies
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/BPStructs.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 57a418e8d0..42ca1545a5 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -244,6 +244,15 @@ static void BPWritten(const BPCmd& bp) WARN_LOG_FMT(VIDEO, "Oversized EFB copy: {}x{} (offset {},{} stride {})", srcRect.GetWidth(), srcRect.GetHeight(), srcRect.left, srcRect.top, destStride); + if (u32(srcRect.left) >= EFB_WIDTH || u32(srcRect.top) >= EFB_HEIGHT) + { + // This is not a sane src rectangle, it doesn't touch any valid image data at all + // Just ignore it + // Apparently Mario Kart Wii in wifi mode can generate a deformed EFB copy of size 4x4 + // at offset (328,1020) + return; + } + // Clamp the copy region to fit within EFB. So that we don't end up with a stretched image. srcRect.right = std::clamp<int>(srcRect.right, 0, EFB_WIDTH); srcRect.bottom = std::clamp<int>(srcRect.bottom, 0, EFB_HEIGHT); |
