From 2054d9d68964452df71c2e7501b6901718742907 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 7 May 2016 23:20:10 +0600 Subject: [PATCH] Fix FrameBuffer::copyRdram(): fingerprint size must be not less than 4. Fixed validity check for PD cloacking effect, #839 --- src/FrameBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FrameBuffer.cpp b/src/FrameBuffer.cpp index 68670d1d..8fdaa0f3 100644 --- a/src/FrameBuffer.cpp +++ b/src/FrameBuffer.cpp @@ -335,7 +335,7 @@ void FrameBuffer::copyRdram() // This is necessary for auxilary buffers: game can restore content of RDRAM when buffer is not needed anymore // Thus content of RDRAM on moment of buffer creation will be the same as when buffer becomes obsolete. // Validity check will see that the RDRAM is the same and thus the buffer is valid, which is false. - const u32 twoPercent = dataSize / 200; + const u32 twoPercent = max(4U, dataSize / 200); u32 start = m_startAddress >> 2; u32 * pData = (u32*)RDRAM; for (u32 i = 0; i < twoPercent; ++i) {