summaryrefslogtreecommitdiffstats
path: root/sub/subreader.c
diff options
context:
space:
mode:
Diffstat (limited to 'sub/subreader.c')
-rw-r--r--sub/subreader.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sub/subreader.c b/sub/subreader.c
index 2ecc41c346..1f88b220d1 100644
--- a/sub/subreader.c
+++ b/sub/subreader.c
@@ -1106,9 +1106,11 @@ static subtitle *sub_read_line_jacosub(stream_t* st, subtitle * current,
} //-- switch
} //-- for
*q = '\0';
- current->text[current->lines] = strdup(line1);
+ if (current->lines < SUB_MAX_TEXT)
+ current->text[current->lines] = strdup(line1);
} //-- while
- current->lines++;
+ if (current->lines < SUB_MAX_TEXT)
+ current->lines++;
return current;
}