Skip to content

Commit 2b6cfb0

Browse files
adgllorenteAnteWall
authored andcommitted
Trim base64 subtitles (shaka-project#2030)
This trims the textContent containing the base64 code of the subtitles, to avoid trying to decode newlines and other whitespace as part of the base64-encoded data. Fixes shaka-project#2028
1 parent 87534e7 commit 2b6cfb0

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ Tomas Tichy <mr.tichyt@gmail.com>
5151
Toshihiro Suzuki <t.suzuki326@gmail.com>
5252
uStudio Inc. <*@ustudio.com>
5353
Verizon Digital Media Services <*@verizondigitalmedia.com>
54+
Adrián Gómez Llorente <adgllorente@gmail.com>

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,4 @@ Toshihiro Suzuki <t.suzuki326@gmail.com>
8484
Vasanth Polipelli <vasanthap@google.com>
8585
Vignesh Venkatasubramanian <vigneshv@google.com>
8686
Yohann Connell <robinconnell@google.com>
87+
Adrián Gómez Llorente <adgllorente@gmail.com>

lib/text/ttml_text_parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ shaka.text.TtmlTextParser = class {
461461
if (imageElement) {
462462
const backgroundImageType = imageElement.getAttribute('imagetype');
463463
const backgroundImageEncoding = imageElement.getAttribute('encoding');
464-
const backgroundImageData = imageElement.textContent;
464+
const backgroundImageData = imageElement.textContent.trim();
465465
if (backgroundImageType == 'PNG' &&
466466
backgroundImageEncoding == 'Base64' &&
467467
backgroundImageData) {

0 commit comments

Comments
 (0)