# HG changeset patch # User gpoirier # Date 1150283979 0 # Node ID b1d546882d90a301005da44e54235a772222bbb6 # Parent c1ac0d17b6a2eff335a22f0368809c2de02503b9 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 diff -r c1ac0d17b6a2 -r b1d546882d90 subreader.c --- 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; }