blob: 0d8d9004aa927996bbfaf3ed7eddb1fe117e08ce [file] [log] [blame]
From 71bb9a0967dc9e9047cf647e3c5594ce379edb2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Marchesin?= <marcheu@chromium.org>
Date: Mon, 7 Mar 2016 18:25:25 -0800
Subject: [PATCH] CHROMIUM: Avoid crash when overflowing the samplers array
Change-Id: I191a833c3849011ff52a7c3da98a651e0e155c7a
---
src/compiler/glsl/link_uniforms.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index 940cc61..f61e478 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -630,6 +630,7 @@ private:
*/
uniform->opaque[shader_type].index = this->next_sampler;
this->next_sampler += MAX2(1, uniform->array_elements);
+ this->next_sampler = MIN2(this->next_sampler, MAX_SAMPLERS);
}
const gl_texture_index target = base_type->sampler_index();
--
2.7.0.rc3.207.g0ac5344