changeset 18704:b1d546882d90

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
author gpoirier
date Wed, 14 Jun 2006 11:19:39 +0000
parents c1ac0d17b6a2
children 9a731c61c870
files subreader.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Wed Jun 14 11:17:21 2006 +0000
+++ b/subreader.c	Wed Jun 14 11:19:39 2006 +0000
@@ -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;
 			}