# HG changeset patch # User reimar # Date 1275936800 0 # Node ID 0fc579d95340a209a81bae04010157fc03bf1d88 # Parent 2d75e55e74bc9588d407d3642aac1a5e60632574 Ensure the SAMI subtitle reader does not read more lines than we support. diff -r 2d75e55e74bc -r 0fc579d95340 subreader.c --- 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, "
", 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); }