From b66eb03b2f26eecfd84650cebbc7d864a66fc15d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 14 Jul 2014 00:48:07 -0400 Subject: [PATCH] OGL: Correctly guard against array bounds of s_encodingPrograms s_encodingPrograms is defined as an array with a length of 64 NUM_ENCODING_PROGRAMS is also defined as 64. However 64 is out of bounds, so we want to be comparing for "equal to or greater than here" --- Source/Core/VideoBackends/OGL/TextureConverter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoBackends/OGL/TextureConverter.cpp b/Source/Core/VideoBackends/OGL/TextureConverter.cpp index f4300db292..055a1e6d7c 100644 --- a/Source/Core/VideoBackends/OGL/TextureConverter.cpp +++ b/Source/Core/VideoBackends/OGL/TextureConverter.cpp @@ -134,7 +134,7 @@ static void CreatePrograms() static SHADER &GetOrCreateEncodingShader(u32 format) { - if (format > NUM_ENCODING_PROGRAMS) + if (format >= NUM_ENCODING_PROGRAMS) { PanicAlert("Unknown texture copy format: 0x%x\n", format); return s_encodingPrograms[0];