From e579a5057dc073d9c57e3ed91459102ba576822f Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sun, 30 Nov 2014 20:25:22 +0100 Subject: [PATCH] Fixed possible memory corruption in ProcessThread::init(). --- LameXP_VS2013.vcxproj | 24 +++++++++--------------- src/Config.h | 2 +- src/Global_Win32.cpp | 1 - src/Main.cpp | 2 +- src/Thread_Process.cpp | 2 +- 5 files changed, 12 insertions(+), 19 deletions(-) diff --git a/LameXP_VS2013.vcxproj b/LameXP_VS2013.vcxproj index 3cb2bf74..762348a1 100644 --- a/LameXP_VS2013.vcxproj +++ b/LameXP_VS2013.vcxproj @@ -93,20 +93,16 @@ "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) QtCored4.lib;QtGuid4.lib;Winmm.lib;Shlwapi.lib;Sensapi.lib;PowrProf.lib;psapi.lib;%(AdditionalDependencies) - $(QTDIR)\lib;$(QTDIR)\plugins\imageformats;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\lib\Win32;$(SolutionDir)\etc\Prerequisites\keccak\lib\$(Configuration);%(AdditionalLibraryDirectories) + $(QTDIR)\lib;$(QTDIR)\plugins\imageformats;$(SolutionDir)\..\Prerequisites\VisualLeakDetector\lib\Win32;$(SolutionDir)\etc\Prerequisites\keccak\lib\$(Configuration);%(AdditionalLibraryDirectories) true Windows MachineX86 lamexp_entry_point - Copy plugin DLL%27s - mkdir "$(TargetDir)imageformats" -copy /Y "$(QTDIR)\plugins\imageformats\q???d4.dll" "$(TargetDir)imageformats\" -copy /Y "$(QTDIR)\plugins\imageformats\q????d4.dll" "$(TargetDir)imageformats\" -copy /Y "$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\bin\Win32\*.dll" "$(TargetDir)" -copy /Y "$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\bin\Win32\*.manifest" "$(TargetDir)" - + Copy VLD DLL%27s + copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\Win32\*.dll" "$(TargetDir)" +copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\Win32\*.manifest" "$(TargetDir)" _CONFIG_NAME=$(ConfigurationName);%(PreprocessorDefinitions) @@ -174,16 +170,14 @@ copy /Y "$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\bin\Win32\*.manifes - $(QTDIR)\lib;$(QTDIR)\plugins\imageformats;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\lib\Win32;$(SolutionDir)\etc\Prerequisites\keccak\lib\$(Configuration);%(AdditionalLibraryDirectories) + $(QTDIR)\lib;$(QTDIR)\plugins\imageformats;$(SolutionDir)\..\Prerequisites\VisualLeakDetector\lib\Win32;$(SolutionDir)\etc\Prerequisites\keccak\lib\$(Configuration);%(AdditionalLibraryDirectories) true - Copy plugin DLL%27s - mkdir "$(TargetDir)imageformats" -copy /Y "$(QTDIR)\plugins\imageformats\q???4.dll" "$(TargetDir)imageformats\" -copy /Y "$(QTDIR)\plugins\imageformats\q????4.dll" "$(TargetDir)imageformats\" -del "$(TargetDir)imageformats\q???d4.dll" - + + + + _CONFIG_NAME=$(ConfigurationName);%(PreprocessorDefinitions) diff --git a/src/Config.h b/src/Config.h index 92b6926e..6b8f54c0 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 1 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 3 -#define VER_LAMEXP_BUILD 1606 +#define VER_LAMEXP_BUILD 1607 #define VER_LAMEXP_CONFG 1558 /////////////////////////////////////////////////////////////////////////////// diff --git a/src/Global_Win32.cpp b/src/Global_Win32.cpp index 3e5123ec..3e997820 100644 --- a/src/Global_Win32.cpp +++ b/src/Global_Win32.cpp @@ -160,7 +160,6 @@ const char* LAMEXP_DEFAULT_TRANSLATION = "LameXP_EN.qm"; */ static __forceinline bool lamexp_check_for_debugger(void) { - return false; //FIXME !!! __try { CloseHandle((HANDLE)((DWORD_PTR)-3)); diff --git a/src/Main.cpp b/src/Main.cpp index 79cb344b..cc0ac17a 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -189,7 +189,7 @@ static int lamexp_main(int &argc, char **argv) { //Show main window poMainWindow->show(); - iResult = QApplication::instance()->exec(); + iResult = qApp->exec(); bAccepted = poMainWindow->isAccepted(); //Sync settings diff --git a/src/Thread_Process.cpp b/src/Thread_Process.cpp index 457b59f4..5c33c5ba 100644 --- a/src/Thread_Process.cpp +++ b/src/Thread_Process.cpp @@ -118,7 +118,7 @@ bool ProcessThread::init(void) emit processStateInitialized(m_jobId, QFileInfo(m_audioFile.filePath()).fileName(), tr("Starting..."), ProgressModel::JobRunning); //Initialize log - handleMessage(QString().sprintf("LameXP v%u.%02u (Build #%u), compiled on %s at %s", lamexp_version_major(), lamexp_version_minor(), lamexp_version_build(), MUtils::Version::app_build_date().toString(Qt::ISODate).toLatin1().constData(), MUtils::Version::app_build_time())); + handleMessage(QString().sprintf("LameXP v%u.%02u (Build #%u), compiled on %s at %s", lamexp_version_major(), lamexp_version_minor(), lamexp_version_build(), MUTILS_UTF8(MUtils::Version::app_build_date().toString(Qt::ISODate)), MUTILS_UTF8(MUtils::Version::app_build_time().toString(Qt::ISODate)))); handleMessage("\n-------------------------------\n"); return true;