From 0aa8fe0f207b63797f61a830b2eb514d6d5ffaab Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Thu, 28 Apr 2016 21:36:21 +0100 Subject: [PATCH] GSDX: Avoid crash when TBW == 0 --- plugins/GSdx/GSTextureCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 70b823271c..56adc6e055 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -435,7 +435,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int // From a performance point of view, it might cost a little on big upscaling // but normally few RT are miss so it must remain reasonable. if (s_IS_OPENGL) { - if (m_preload_frame) { + if (m_preload_frame && TEX0.TBW > 0) { GL_INS("Preloading the RT DATA"); // RT doesn't have height but if we use a too big value, we will read outside of the GS memory. int page0 = TEX0.TBP0 >> 5;