From 5f8d3b9e4be81d6c486fcf05fcd8d52f41ac8bb3 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 11 Jul 2015 14:34:29 +0200 Subject: [PATCH] gsdx-tc: remains in the memory avoid a crash with kungfu panda --- plugins/GSdx/GSTextureCache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 3f806007e7..0778979818 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -491,11 +491,11 @@ void GSTextureCache::InvalidateVideoMem(GSOffset* off, const GSVector4i& rect, b } } - if (bw >= 16) { + uint32 bbp = bp + bw * 0x10; + if (bw >= 16 && bbp < 16384) { // Detect half of the render target (fix snow engine game) // Target Page (8KB) have always a width of 64 pixels // Half of the Target is TBW/2 pages * 8KB / (1 block * 256B) = 0x10 - uint32 bbp = bp + bw * 0x10; const list& m = m_src.m_map[bbp >> 5];