mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
fix the end point of span exceeds the length of SpannableStringBuilder
This commit is contained in:
parent
af4028f30e
commit
4bc392a8ef
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue