summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@googlemail.com>2010-06-02 23:47:01 +0200
committerSteve Kondik <shade@chemlab.org>2011-01-21 00:02:31 -0500
commit433de557b0ed9e30599f86572b4ea8b8ee0908a8 (patch)
treef33e844975d56decba996785124798165a9f655e /graphics
parent0a0566834607facdbae3f6c28727b0d387463b01 (diff)
downloadframeworks_base-433de557b0ed9e30599f86572b4ea8b8ee0908a8.zip
frameworks_base-433de557b0ed9e30599f86572b4ea8b8ee0908a8.tar.gz
frameworks_base-433de557b0ed9e30599f86572b4ea8b8ee0908a8.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 8ac2aa0..a587d0d 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);