From 074e6b4622429ee4f378d31be7537f72e4d4e7f2 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 7 Jun 2010 18:53:20 +0000 Subject: [PATCH] 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 --- subreader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subreader.c b/subreader.c index 59209d9d59..200fd6f9f5 100644 --- a/subreader.c +++ b/subreader.c @@ -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, "
", 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); }