summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2014-05-14 23:15:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-14 23:15:22 +0000
commita6464b38fc3c807abbce0cb4e7b542b2dd34111c (patch)
tree92185b9dbecea4e046b7e9f8eec18c6b490c89fe /libs
parent4a644e390359a1715c88f54ed0174ffb5113d617 (diff)
parentf11310f395a135ac7ef204ced5b3d3facf491422 (diff)
downloadframeworks_base-a6464b38fc3c807abbce0cb4e7b542b2dd34111c.zip
frameworks_base-a6464b38fc3c807abbce0cb4e7b542b2dd34111c.tar.gz
frameworks_base-a6464b38fc3c807abbce0cb4e7b542b2dd34111c.tar.bz2
Merge "Check the array before accessing it"
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/ShadowTessellator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp
index be49aed..55b82e4 100644
--- a/libs/hwui/ShadowTessellator.cpp
+++ b/libs/hwui/ShadowTessellator.cpp
@@ -196,6 +196,10 @@ Vector2 ShadowTessellator::centroid2d(const Vector2* poly, int polyLength) {
* @param len the number of points of the polygon
*/
bool ShadowTessellator::isClockwise(const Vector2* polygon, int len) {
+ if (len < 2 || polygon == NULL) {
+ ALOGW("Invalid polygon %p, length is %d @ isClockwise()", polygon, len);
+ return true;
+ }
double sum = 0;
double p1x = polygon[len - 1].x;
double p1y = polygon[len - 1].y;