Commit 4bc392a8 by xufuji456

fix the end point of span exceeds the length of SpannableStringBuilder

parent af4028f3
...@@ -185,6 +185,9 @@ public final class Tx3gDecoder extends SimpleSubtitleDecoder { ...@@ -185,6 +185,9 @@ public final class Tx3gDecoder extends SimpleSubtitleDecoder {
int fontFace = parsableByteArray.readUnsignedByte(); int fontFace = parsableByteArray.readUnsignedByte();
parsableByteArray.skipBytes(1); // font size parsableByteArray.skipBytes(1); // font size
int colorRgba = parsableByteArray.readInt(); int colorRgba = parsableByteArray.readInt();
if (end > cueText.length()) {
end = cueText.length();
}
attachFontFace(cueText, fontFace, defaultFontFace, start, end, SPAN_PRIORITY_HIGH); attachFontFace(cueText, fontFace, defaultFontFace, start, end, SPAN_PRIORITY_HIGH);
attachColor(cueText, colorRgba, defaultColorRgba, start, end, SPAN_PRIORITY_HIGH); attachColor(cueText, colorRgba, defaultColorRgba, start, end, SPAN_PRIORITY_HIGH);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment