diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index e33555803e..24edd6bed6 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -233,7 +233,8 @@ void Pcsx2Config::GSOptions::LoadSave( IniInterface& ini ) IniEntry( FramerateNTSC ); IniEntry( FrameratePAL ); - static const wxChar * const ntsc_pal_str[2] = { L"ntsc", L"pal" }; + // WARNING: array must be NULL terminated to compute it size + static const wxChar * const ntsc_pal_str[3] = { L"ntsc", L"pal", NULL }; ini.EnumEntry( L"DefaultRegionMode", DefaultRegionMode, ntsc_pal_str, DefaultRegionMode ); IniEntry( FramesToDraw ); diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 60e0dcb84a..3f7f25b009 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -518,6 +518,8 @@ void App_LoadSaveInstallSettings( IniInterface& ini ) { L"User", L"Custom", + // WARNING: array must be NULL terminated to compute it size + NULL }; ini.EnumEntry( L"DocumentsFolderMode", DocsFolderMode, DocsFolderModeNames, (InstallationMode == InstallMode_Registered) ? DocsFolder_User : DocsFolder_Custom); @@ -822,6 +824,8 @@ void AppConfig::GSWindowOptions::LoadSave( IniInterface& ini ) L"Stretch", L"4:3", L"16:9", + // WARNING: array must be NULL terminated to compute it size + NULL }; ini.EnumEntry( L"AspectRatio", AspectRatio, AspectRatioNames, AspectRatio ); diff --git a/pcsx2/gui/ConsoleLogger.cpp b/pcsx2/gui/ConsoleLogger.cpp index 8817269202..36efbc206c 100644 --- a/pcsx2/gui/ConsoleLogger.cpp +++ b/pcsx2/gui/ConsoleLogger.cpp @@ -323,6 +323,7 @@ public: } }; +// WARNING ConsoleLogSources & ConLogDefaults must have the same size static ConsoleLogSource* const ConLogSources[] = { (ConsoleLogSource*)&SysConsole.eeConsole, @@ -335,6 +336,7 @@ static ConsoleLogSource* const ConLogSources[] = (ConsoleLogSource*)&pxConLog_Thread, }; +// WARNING ConsoleLogSources & ConLogDefaults must have the same size static const bool ConLogDefaults[] = { true, @@ -343,6 +345,8 @@ static const bool ConLogDefaults[] = true, false, false, + false, + false }; void ConLog_LoadSaveSettings( IniInterface& ini ) diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index ac6f505655..6920f55666 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -1062,7 +1062,8 @@ void GSTextureCache::Source::Flush(uint32 count) if(count < m_write.count) { - memcpy(&m_write.rect[0], &m_write.rect[count], (m_write.count - count) * sizeof(m_write.rect[0])); + // Warning src and destination overlap. Memmove must be used instead of memcpy + memmove(&m_write.rect[0], &m_write.rect[count], (m_write.count - count) * sizeof(m_write.rect[0])); } m_write.count -= count; diff --git a/plugins/GSdx/stdafx.h b/plugins/GSdx/stdafx.h index 37b6ac7c00..60e60301f5 100644 --- a/plugins/GSdx/stdafx.h +++ b/plugins/GSdx/stdafx.h @@ -71,6 +71,7 @@ typedef signed long long int64; #include #include +#include #include #include #include