mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-27 22:06:58 +08:00
sd_ass: fix nonsense
Actually check the newly added text for whitespace, and not the uninitialized buffer after it. Also, if an even is only whitespace, don't add it at all.
This commit is contained in:
+4
-1
@@ -275,8 +275,11 @@ static char *get_text(struct sd *sd, double pts)
|
||||
if (event->Text) {
|
||||
int start = b.len;
|
||||
ass_to_plaintext(&b, event->Text);
|
||||
if (!is_whitespace_only(&b.start[b.len], b.len - start))
|
||||
if (is_whitespace_only(&b.start[start], b.len - start)) {
|
||||
b.len = start;
|
||||
} else {
|
||||
append(&b, '\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user