summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--subreader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/subreader.c b/subreader.c
index 91d3707bc3..03db411b02 100644
--- a/subreader.c
+++ b/subreader.c
@@ -2336,8 +2336,10 @@ int sub_clear_text(subtitle *sub, double pts) {
if (pts == MP_NOPTS_VALUE || (endpts != MP_NOPTS_VALUE && pts >= endpts)) {
int j;
free(sub->text[i]);
- for (j = i + 1; j < sub->lines; j++)
+ for (j = i + 1; j < sub->lines; j++) {
sub->text[j - 1] = sub->text[j];
+ sub->endpts[j - 1] = sub->endpts[j];
+ }
sub->lines--;
changed = 1;
} else