diff --git a/Source/Core/DiscIO/Src/BannerLoader.cpp b/Source/Core/DiscIO/Src/BannerLoader.cpp index 8a1931db1e..ff7d888207 100644 --- a/Source/Core/DiscIO/Src/BannerLoader.cpp +++ b/Source/Core/DiscIO/Src/BannerLoader.cpp @@ -43,20 +43,20 @@ bool IBannerLoader::CopyToStringAndCheck(std::string& _rDestination, const char* } // generate valid chars - for (unsigned char c = 0x20; c <= 0x80; c++) + for (int i = 0x20; i < 256; i++) { - bValidChars[c] = true; + bValidChars[i] = true; } bValidChars[0x0a] = true; - bValidChars[0xa9] = true; - bValidChars[0xe9] = true; + //bValidChars[0xa9] = true; + //bValidChars[0xe9] = true; bInitialized = true; } bool bResult = true; - char destBuffer[2048]; + char destBuffer[2048] = {0}; char* dest = destBuffer; const char* src = _src; diff --git a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp index 28e8378db4..a7a911642a 100644 --- a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp +++ b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp @@ -107,9 +107,17 @@ CBannerLoaderGC::GetName(std::string _rName[]) case CBannerLoaderGC::BANNER_BNR1: { DVDBanner* pBanner = (DVDBanner*)m_pBannerFile; - char tempBuffer[33] = {0}; - memcpy(tempBuffer, pBanner->comment.shortTitle, 32); - _rName[0] = tempBuffer; + char tempBuffer[65] = {0}; + if (pBanner->comment.longTitle[0]) + { + memcpy(tempBuffer, pBanner->comment.longTitle, 64); + } + else + { + memcpy(tempBuffer, pBanner->comment.shortTitle, 32); + } + + CopyToStringAndCheck(_rName[0], tempBuffer); returnCode = true; } break; @@ -120,9 +128,16 @@ CBannerLoaderGC::GetName(std::string _rName[]) u32 languageID = SConfig::GetInstance().m_InterfaceLanguage; for (int i = 0; i < 6; i++) { - char tempBuffer[33] = {0}; - memcpy(tempBuffer, pBanner->comment[i].shortTitle, 32); - _rName[i] = tempBuffer; + char tempBuffer[65] = {0}; + if (pBanner->comment[i].longTitle[0]) + { + memcpy(tempBuffer, pBanner->comment[i].longTitle, 64); + } + else + { + memcpy(tempBuffer, pBanner->comment[i].shortTitle, 32); + } + CopyToStringAndCheck(_rName[i], tempBuffer); } returnCode = true; @@ -174,7 +189,7 @@ CBannerLoaderGC::GetDescription(std::string* _rDescription) DVDBanner* pBanner = (DVDBanner*)m_pBannerFile; char tempBuffer[129] = {0}; memcpy(tempBuffer, pBanner->comment.comment, 128); - _rDescription[0] = tempBuffer; + CopyToStringAndCheck(_rDescription[0], tempBuffer); returnCode = true; } break; @@ -186,7 +201,7 @@ CBannerLoaderGC::GetDescription(std::string* _rDescription) { char tempBuffer[129] = {0}; memcpy(tempBuffer, pBanner->comment[i].comment, 128); - _rDescription[i] = tempBuffer; + CopyToStringAndCheck(_rDescription[i], tempBuffer); } returnCode = true; }