fix #4255: crash on some Samsung devices when computing rotation matrix