From 16136b04e91f5a29eab15d976a50925e2f1d7925 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Thu, 24 Sep 2015 18:10:53 +0600 Subject: [PATCH] Do not set buffer's height to VI.height if it is zero. WARNING: potentially dangerous! --- src/gDP.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gDP.cpp b/src/gDP.cpp index 235f32c9..0b1ff9c9 100644 --- a/src/gDP.cpp +++ b/src/gDP.cpp @@ -129,10 +129,11 @@ void gDPSetColorImage( u32 format, u32 size, u32 width, u32 address ) if (gDP.colorImage.address != address || gDP.colorImage.width != width || gDP.colorImage.size != size) { u32 height = 1; if (width == VI.width) - height = VI.height; + height = VI.height > 0 ? VI.height : gDP.scissor.lry; else if (!RSP.bLLE && width == gDP.scissor.lrx && width == gSP.viewport.width) { height = max(gDP.scissor.lry, gSP.viewport.height); - height = min(height, VI.height); + if (VI.height > 0) + height = min(height, VI.height); } else if (width == gDP.scissor.lrx) height = gDP.scissor.lry; else if (width <= 64)