|
From: <sag...@us...> - 2010-08-31 21:42:39
|
Revision: 691
http://modplug.svn.sourceforge.net/modplug/?rev=691&view=rev
Author: saga-games
Date: 2010-08-31 21:42:33 +0000 (Tue, 31 Aug 2010)
Log Message:
-----------
[Fix] MO3 Loader: unmo3.dll is now loaded from mptrack.exe's directory, to avoid the currently spreading DLL exploits.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_mo3.cpp
Modified: trunk/OpenMPT/soundlib/Load_mo3.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mo3.cpp 2010-08-31 21:39:27 UTC (rev 690)
+++ trunk/OpenMPT/soundlib/Load_mo3.cpp 2010-08-31 21:42:33 UTC (rev 691)
@@ -10,6 +10,7 @@
#include "Loaders.h"
#ifdef MODPLUG_TRACKER
#include "../mptrack/moddoc.h"
+#include "../mptrack/Mptrack.h"
#endif // MODPLUG_TRACKER
// decode a MO3 file (returns the same "exit codes" as UNMO3.EXE, eg. 0=success)
@@ -28,7 +29,7 @@
return false;
#ifdef NO_MO3_SUPPORT
- /* As of August 2009, the format revision is 5; Versions > 31 are unlikely to exist in the next few years,
+ /* As of August 2010, the format revision is 5; Versions > 31 are unlikely to exist in the next few years,
so we will just ignore those if there's no UNMO3 library to tell us if the file is valid or not
(avoid log entry with .MOD files that have a song name starting with "MO3" */
if(lpStream[3] > 31) return false;
@@ -45,7 +46,14 @@
void **mo3Stream = (void **)&lpStream;
// try to load unmo3.dll dynamically.
+#ifdef MODPLUG_TRACKER
+ CHAR szPath[MAX_PATH];
+ strcpy(szPath, theApp.GetAppDirPath());
+ _tcsncat(szPath, _TEXT("unmo3.dll"), MAX_PATH - strlen(szPath));
+ HMODULE unmo3 = LoadLibrary(szPath);
+#else
HMODULE unmo3 = LoadLibrary(_TEXT("unmo3.dll"));
+#endif // MODPLUG_TRACKER
if(unmo3 == NULL) // Didn't succeed.
{
#ifdef MODPLUG_TRACKER
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|