[MPlayer-cvslog] r35313 - trunk/sub/subreader.c

reimar subversion at mplayerhq.hu
Wed Oct 31 21:05:31 CET 2012


Author: reimar
Date: Wed Oct 31 21:05:31 2012
New Revision: 35313

Log:
Extra checks to ensure we really do not write outside
array bounds.

Modified:
   trunk/sub/subreader.c

Modified: trunk/sub/subreader.c
==============================================================================
--- trunk/sub/subreader.c	Wed Oct 31 20:50:11 2012	(r35312)
+++ trunk/sub/subreader.c	Wed Oct 31 21:05:31 2012	(r35313)
@@ -1097,9 +1097,11 @@ static subtitle *sub_read_line_jacosub(s
 	    }			//-- switch
 	}			//-- for
 	*q = '\0';
-	current->text[current->lines] = strdup(line1);
+	if (current->lines < SUB_MAX_TEXT)
+	    current->text[current->lines] = strdup(line1);
     }				//-- while
-    current->lines++;
+    if (current->lines < SUB_MAX_TEXT)
+        current->lines++;
     return current;
 }
 


More information about the MPlayer-cvslog mailing list