shader-effect: Add a size check

Similar to the one in commit 2a354d9650
that went into clutter_value_set_shader_*. We end up in the same
situation, but it's better to fail from within ClutterShaderEffect.
This commit is contained in:
Emmanuele Bassi 2010-06-16 17:17:27 +01:00
parent 2a354d9650
commit 698cce8276

View File

@ -637,6 +637,8 @@ clutter_shader_effect_set_uniform_valist (ClutterShaderEffect *effect,
if (value_type == G_TYPE_INT) 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 /* 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 * of using G_TYPE_INT, otherwise we create a vector of integers
* from the passed values * from the passed values
@ -667,6 +669,8 @@ clutter_shader_effect_set_uniform_valist (ClutterShaderEffect *effect,
if (value_type == G_TYPE_FLOAT) 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 /* 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 * of using G_TYPE_FLOAT, otherwise we create a vector of floats
* from the passed values * from the passed values