From bbc71c3f0ac888a63787606cfed4f6008d3bb6b9 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Tue, 5 May 2015 17:07:21 +0600 Subject: [PATCH] Fix crash in FrameBufferToRDRAM::CopyToRDRAM when current buffer is NULL. Fixed Snowboard Kids causes segmentation fault #477 --- src/FrameBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FrameBuffer.cpp b/src/FrameBuffer.cpp index 27c0bcf5..9a0d3ab8 100644 --- a/src/FrameBuffer.cpp +++ b/src/FrameBuffer.cpp @@ -903,7 +903,7 @@ void FrameBufferToRDRAM::_copyWhite(FrameBuffer * _pBuffer) void FrameBufferToRDRAM::CopyToRDRAM(u32 _address) { - if (VI.width == 0) // H width is zero. Don't copy + if (VI.width == 0 || frameBufferList().getCurrent() == NULL) // H width is zero or no current buffer. Don't copy return; FrameBuffer *pBuffer = frameBufferList().findBuffer(_address); if (pBuffer == NULL || pBuffer->m_width < VI.width || pBuffer->m_isOBScreen)