mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 04:22:05 +00:00
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:
parent
2a354d9650
commit
698cce8276
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user