diff options
author | Ton Roosendaal <ton@blender.org> | 2010-11-15 16:33:38 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2010-11-15 16:33:38 +0300 |
commit | e3ace7ee627eeab6938e055674005c0a08a35b49 (patch) | |
tree | 01d19281cdd33929753cd59854484b2c84f990dc /source/blender/blenlib | |
parent | 070f38a6d036068b56d0bf3c9e1f58b1724cc21b (diff) |
Bugfix, reported in IRC
The enum "rotmode" was read using an array, without checking for boundary
cases, causing crashes on bad input. (Wahooney report 2, thanks!)
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 2d0e347b2e6..632c1da8740 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -1084,7 +1084,7 @@ static RotOrderInfo rotOrders[]= { * NOTE: since we start at 1 for the values, but arrays index from 0, * there is -1 factor involved in this process... */ -#define GET_ROTATIONORDER_INFO(order) (((order)>=1) ? &rotOrders[(order)-1] : &rotOrders[0]) +#define GET_ROTATIONORDER_INFO(order) ( ((order)>5 || (order < 1)) ? &rotOrders[0] : &rotOrders[(order)-1] ) /* Construct quaternion from Euler angles (in radians). */ void eulO_to_quat(float q[4], const float e[3], const short order) |