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

gpoirier subversion at mplayerhq.hu
Wed Jun 14 13:19:40 CEST 2006


Author: gpoirier
Date: Wed Jun 14 13:19:39 2006
New Revision: 18707

Modified:
   trunk/subreader.c

Log:
Fix problem when subtitle file name is shorter than ".utf-8"
Patch by Evgeniy Stepanov < eugeni P stepanov A gmail P com >
Original thread:
Date: May 23, 2006 10:57 PM
Subject: [MPlayer-dev-eng] [BUG][PATCH] uninitialized memory access in subreader.c


Modified: trunk/subreader.c
==============================================================================
--- trunk/subreader.c	(original)
+++ trunk/subreader.c	Wed Jun 14 13:19:39 2006
@@ -1398,7 +1398,7 @@
 	    if ((l=strlen(filename))>4){
 		    char *exts[] = {".utf", ".utf8", ".utf-8" };
 		    for (k=3;--k>=0;)
-			if (!strcasecmp(filename+(l - strlen(exts[k])), exts[k])){
+			if (l >= strlen(exts[k]) && !strcasecmp(filename+(l - strlen(exts[k])), exts[k])){
 			    sub_utf8 = 1;
 			    break;
 			}



More information about the MPlayer-cvslog mailing list