changeset 31279:0fc579d95340

Ensure the SAMI subtitle reader does not read more lines than we support.
author reimar
date Mon, 07 Jun 2010 18:53:20 +0000
parents 2d75e55e74bc
children 17db8e56de4c
files subreader.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Mon Jun 07 17:52:28 2010 +0000
+++ b/subreader.c	Mon Jun 07 18:53:20 2010 +0000
@@ -163,7 +163,7 @@
 	    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;
 	    }
@@ -244,7 +244,7 @@
     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);
     }