[MPlayer-cvslog] r32025 - in trunk: loader/module.c mplayer.c

reimar subversion at mplayerhq.hu
Fri Aug 27 18:28:53 CEST 2010


Author: reimar
Date: Fri Aug 27 18:28:53 2010
New Revision: 32025

Log:
Disable loading codecs from the current directory.
While convenient, it is too risky.

Modified:
   trunk/loader/module.c
   trunk/mplayer.c

Modified: trunk/loader/module.c
==============================================================================
--- trunk/loader/module.c	Fri Aug 27 18:19:24 2010	(r32024)
+++ trunk/loader/module.c	Fri Aug 27 18:28:53 2010	(r32025)
@@ -381,6 +381,10 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR lib
 //	if(fs_installed==0)
 //	    install_fs();
 
+	// Do not load libraries from a path relative to the current directory
+	if (*libname != '/')
+	    i++;
+
 	while (wm == 0 && listpath[++i])
 	{
 	    if (i < 2)

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Fri Aug 27 18:19:24 2010	(r32024)
+++ trunk/mplayer.c	Fri Aug 27 18:28:53 2010	(r32025)
@@ -2768,9 +2768,13 @@ int gui_no_filename=0;
 	{
 		HMODULE kernel32 = GetModuleHandle("Kernel32.dll");
 		BOOL WINAPI (*setDEP)(DWORD) = NULL;
-		if (kernel32)
+		BOOL WINAPI (*setDllDir)(LPCTSTR) = NULL;
+		if (kernel32) {
 			setDEP = GetProcAddress(kernel32, "SetProcessDEPPolicy");
+			setDllDir = GetProcAddress(kernel32, "SetDllDirectory");
+		}
 		if (setDEP) setDEP(3);
+		if (setDllDir) setDllDir("");
 	}
 	// stop Windows from showing all kinds of annoying error dialogs
 	SetErrorMode(0x8003);


More information about the MPlayer-cvslog mailing list