From 88acd219a094bb16cf0d7b4c56a3b890db35edf7 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Wed, 1 Apr 2015 12:33:28 +0600 Subject: [PATCH] Add check that depth image is inside RDRAM bound in DepthBufferToRDRAM::CopyToRDRAM --- FrameBuffer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FrameBuffer.cpp b/FrameBuffer.cpp index a91f73d9..09b748bf 100644 --- a/FrameBuffer.cpp +++ b/FrameBuffer.cpp @@ -947,6 +947,9 @@ bool DepthBufferToRDRAM::CopyToRDRAM( u32 _address) { m_lastDList = RSP.DList; DepthBuffer * pDepthBuffer = pBuffer->m_pDepthBuffer; const u32 address = pDepthBuffer->m_address; + if (address + VI.width*VI.height*2 > RDRAMSize) + return false; + if (config.video.multisampling == 0) glBindFramebuffer(GL_READ_FRAMEBUFFER, pBuffer->m_FBO); else {