[Add] Sanity check to spfx_add()

This commit is contained in:
Allanis 2013-10-04 01:08:53 +01:00
parent 4cac5ba5b2
commit e2b8e738f5

View File

@ -129,6 +129,11 @@ void spfx_add(int effect,
SPFX* cur_spfx; SPFX* cur_spfx;
double ttl, anim; double ttl, anim;
if((effect < 0) || (effect > spfx_neffects)) {
WARN("Trying to add spfx with invalid effect!");
return;
}
/* Select the layer. */ /* Select the layer. */
if(layer == SPFX_LAYER_FRONT) { if(layer == SPFX_LAYER_FRONT) {
/* Front layer. */ /* Front layer. */