subreader.c: check for max line count in SAMI subtitle reader

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31345 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar authored and Uoti Urpala committed 2010-11-02 04:07:12 +02:00
1 parent ae85c8c2ce
commit 074e6b4622
1 file changed
+2 -2
+2 -2
View File
@@ -161,7 +161,7 @@ static subtitle *sub_read_line_sami(stream_t* st, subtitle *current, int utf16)
if (*s == '\0') break;
else if (!strncasecmp (s, "<br>", 4)) {
*p = '\0'; p = text; trail_space (text);
if (text[0] != '\0')
if (text[0] != '\0' && current->lines < SUB_MAX_TEXT)
current->text[current->lines++] = strdup (text);
s += 4;
}
@@ -242,7 +242,7 @@ static subtitle *sub_read_line_sami(stream_t* st, subtitle *current, int utf16)
if (current->end <= 0) {
current->end = current->start + sub_slacktime;
*p = '\0'; trail_space (text);
if (text[0] != '\0')
if (text[0] != '\0' && current->lines < SUB_MAX_TEXT)
current->text[current->lines++] = strdup (text);
}