]> git.sesse.net Git - vlc/commitdiff
Fixed invalid access in file_select (lua).
authorLaurent Aimar <fenrir@videolan.org>
Mon, 8 Feb 2010 19:07:16 +0000 (20:07 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 8 Feb 2010 19:08:07 +0000 (20:08 +0100)
modules/misc/lua/vlc.c

index e03a66b0c35637801425f9e331979d8370d07795..f76b7fe2ff130ccf6c5465d38f650929eaaae6b9 100644 (file)
@@ -139,7 +139,7 @@ static int file_select( const char *file )
     for( j = 0; ppsz_lua_exts[j]; j++ )
     {
         int l = strlen( ppsz_lua_exts[j] );
-        if( !strcmp( file+i-l, ppsz_lua_exts[j] ) )
+        if( i >= l && !strcmp( file+i-l, ppsz_lua_exts[j] ) )
             return 1;
     }
     return 0;