X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fsensor%2Fgravity%2Fgravity_sensor.cpp;h=e071226795fcf773aea2c80acca6b51b20614f8e;hb=6ca45fa7211cbd07b2b7b658a0495c55af9c79b2;hp=8b41fc55e5170339d5cd3b2da3307e2156b49773;hpb=2145ecc1e8c6e879bdc960d926a74d73b504ed88;p=platform%2Fcore%2Fsystem%2Fsensord.git diff --git a/src/sensor/gravity/gravity_sensor.cpp b/src/sensor/gravity/gravity_sensor.cpp index 8b41fc5..e071226 100644 --- a/src/sensor/gravity/gravity_sensor.cpp +++ b/src/sensor/gravity/gravity_sensor.cpp @@ -161,7 +161,10 @@ void gravity_sensor::synthesize_rv(const sensor_event_t& event) float rotation[4] = {x, y, z, w}; - rotation_to_gravity(rotation, gravity); + if (!rotation_to_gravity(rotation, gravity)) { + _D("Invalid rotation_vector: [%10f] [%10f] [%10f] [%10f]", x, y, z, w); + return; + } gravity_event = (sensor_event_t *)malloc(sizeof(sensor_event_t)); if (!gravity_event) {