summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2013-11-24 00:15:08 +1300
committerScott Mansell <phiren@gmail.com>2013-11-24 00:15:08 +1300
commitafe47ff8479ceb816e54aab2523cb6cccf046923 (patch)
treef2e6cddbb6642fe54777cec713161b5936e265ea /Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
parente720ea78372f3eda9baf6c7b3f79a5feed06b92d (diff)
Increase res of color texture to match PAL Super Smash Bros: Brawl
The pal version of SSBB has a 640x568 xfb, which is larger than the efb. Increase the size of the static textures and put in some runtime checks to prevent buffer overruns.
Diffstat (limited to 'Source/Core/VideoBackends/Software/Src/SWRenderer.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/Src/SWRenderer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp b/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
index 83d542bcec..62d2970160 100644
--- a/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
+++ b/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
@@ -20,7 +20,7 @@ static GLint attr_pos = -1, attr_tex = -1;
static GLint uni_tex = -1;
static GLuint program;
-static u8 s_xfbColorTexture[2][EFB_WIDTH*EFB_HEIGHT*4];
+static u8 s_xfbColorTexture[2][640*568*4];
static int s_currentColorTexture = 0;
static volatile bool s_bScreenshot;
@@ -154,6 +154,11 @@ void SWRenderer::swapColorTexture() {
void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb, u32 fbWidth, u32 fbHeight)
{
+ if(fbWidth*fbHeight > 640*568) {
+ ERROR_LOG(VIDEO, "Framebuffer is too large: %ix%i", fbWidth, fbHeight);
+ return;
+ }
+
u32 offset = 0;
u8 *TexturePointer = getColorTexture();