summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@googlemail.com>2010-06-02 23:47:01 +0200
committerErik Faye-Lund <kusmabite@googlemail.com>2010-06-02 23:47:01 +0200
commit92ce5734b52ef014c80cc6335112a027188b3eb6 (patch)
tree4e1b24f0c038d278009202b6882e5f6adc92c43e /graphics
parente99c012503bbd205cbaa9f16f9894ca5ffeaaf76 (diff)
downloadframeworks_base-92ce5734b52ef014c80cc6335112a027188b3eb6.zip
frameworks_base-92ce5734b52ef014c80cc6335112a027188b3eb6.tar.gz
frameworks_base-92ce5734b52ef014c80cc6335112a027188b3eb6.tar.bz2
Canvas.drawVertices: correct color range-check
The range-check in drawVertices previously checked that the color count was equal to the vertex count. However, the vertex count is specified in array elements, and there's two array elements per vertex for the positions, but only one array element per vertex for the colors. Correct the code so the check is consistent with the element count. Change-Id: Id043f1003f9245f18adc91bac49dc33727ca765e
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/Canvas.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index 345f810..76cde73 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -1221,7 +1221,7 @@ public class Canvas {
checkRange(texs.length, texOffset, vertexCount);
}
if (colors != null) {
- checkRange(colors.length, colorOffset, vertexCount);
+ checkRange(colors.length, colorOffset, vertexCount / 2);
}
if (indices != null) {
checkRange(indices.length, indexOffset, indexCount);