[MPlayer-cvslog] r31345 - trunk/subreader.c

reimar subversion at mplayerhq.hu
Mon Jun 7 20:53:20 CEST 2010


Author: reimar
Date: Mon Jun  7 20:53:20 2010
New Revision: 31345

Log:
Ensure the SAMI subtitle reader does not read more lines than we support.

Modified:
   trunk/subreader.c

Modified: trunk/subreader.c
==============================================================================
--- trunk/subreader.c	Mon Jun  7 19:52:28 2010	(r31344)
+++ trunk/subreader.c	Mon Jun  7 20:53:20 2010	(r31345)
@@ -163,7 +163,7 @@ static subtitle *sub_read_line_sami(stre
 	    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 @@ static subtitle *sub_read_line_sami(stre
     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);
     }
 


More information about the MPlayer-cvslog mailing list