Merge "TextLine.handleRun should throw exception for invalid index"

This commit is contained in:
Siyamed Sinir
2016-11-08 00:57:33 +00:00
committed by Android (Google) Code Review

View File

@@ -850,6 +850,11 @@ class TextLine {
int limit, boolean runIsRtl, Canvas c, float x, int top, int y,
int bottom, FontMetricsInt fmi, boolean needWidth) {
if (measureLimit < start || measureLimit > limit) {
throw new IndexOutOfBoundsException("measureLimit (" + measureLimit + ") is out of "
+ "start (" + start + ") and limit (" + limit + ") bounds");
}
// Case of an empty line, make sure we update fmi according to mPaint
if (start == measureLimit) {
TextPaint wp = mWorkPaint;