From 698cce8276eeff945980f16ebe3ac585bd71a9b7 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 16 Jun 2010 17:17:27 +0100 Subject: [PATCH] shader-effect: Add a size check Similar to the one in commit 2a354d9650bb8215dd75a90b947fb82734c35b78 that went into clutter_value_set_shader_*. We end up in the same situation, but it's better to fail from within ClutterShaderEffect. --- clutter/clutter-shader-effect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clutter/clutter-shader-effect.c b/clutter/clutter-shader-effect.c index 0ec465e51..1f4d6d50c 100644 --- a/clutter/clutter-shader-effect.c +++ b/clutter/clutter-shader-effect.c @@ -637,6 +637,8 @@ clutter_shader_effect_set_uniform_valist (ClutterShaderEffect *effect, if (value_type == G_TYPE_INT) { + g_return_if_fail (n_values <= 4); + /* if we only have one value we can go through the fast path * of using G_TYPE_INT, otherwise we create a vector of integers * from the passed values @@ -667,6 +669,8 @@ clutter_shader_effect_set_uniform_valist (ClutterShaderEffect *effect, if (value_type == G_TYPE_FLOAT) { + g_return_if_fail (n_values <= 4); + /* if we only have one value we can go through the fast path * of using G_TYPE_FLOAT, otherwise we create a vector of floats * from the passed values