Skip to content

Commit

Permalink
Merge pull request #18698 from hrydgard/beta-crash-fixes
Browse files Browse the repository at this point in the history
Beta crash fixes 1
  • Loading branch information
hrydgard committed Jan 15, 2024
2 parents 5267ffc + 56c797e commit 15db280
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Common/GPU/Vulkan/VulkanRenderManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ void VulkanRenderManager::ReleaseCompileQueue() {
}

void VulkanRenderManager::ThreadFunc() {
SetCurrentThreadName("RenderMan");
SetCurrentThreadName("VulkanRenderMan");
while (true) {
_dbg_assert_(useRenderThread_);

Expand Down
2 changes: 2 additions & 0 deletions Common/Render/ManagedTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ class TextureLoadTask : public Task {
ERROR_LOG(IO, "Failed to read file '%s'", filename_.c_str());
filename_.clear();
*state_ = ManagedTexture::LoadState::FAILED;
waitable_->Notify();
return;
}

if (!tempImage_->LoadTextureLevels(buffer, fileSize, type_)) {
*state_ = ManagedTexture::LoadState::FAILED;
waitable_->Notify();
return;
}
delete[] buffer;
Expand Down
10 changes: 7 additions & 3 deletions Core/Util/GameDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,17 @@ bool GameDB::GetGameInfos(std::string_view id, std::vector<GameDBInfo> *infos) {
}

for (auto &line : lines_) {
for (auto serial : line.serials) {
for (auto &serial : line.serials) {
// Ignore version and stuff for now
if (IDMatches(id, serial)) {
GameDBInfo info;
if (1 != sscanf(line.crc.data(), "%08x", &info.crc)) {
// zero-terminate before sscanf
std::string crc(line.crc);
if (1 != sscanf(crc.c_str(), "%08x", &info.crc)) {
continue;
}
if (1 != sscanf(line.size.data(), "%llu", (long long *)&info.size)) {
std::string size(line.size);
if (1 != sscanf(size.c_str(), "%llu", (long long *)&info.size)) {
continue;
}
info.title = line.title;
Expand All @@ -143,5 +146,6 @@ bool GameDB::GetGameInfos(std::string_view id, std::vector<GameDBInfo> *infos) {
}
}
}

return !infos->empty();
}
2 changes: 1 addition & 1 deletion UI/EmuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {

if (invalid_) {
// Loading, or after shutdown?
if (loadingTextView_->GetVisibility() == UI::V_VISIBLE)
if (loadingTextView_ && loadingTextView_->GetVisibility() == UI::V_VISIBLE)
loadingTextView_->SetText(PSP_GetLoading());

// It's possible this might be set outside PSP_RunLoopFor().
Expand Down
4 changes: 2 additions & 2 deletions UI/GameScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ ScreenRenderFlags GameScreen::render(ScreenRenderMode mode) {

// Let's check the CRC in the game database, looking up the ID and also matching the crc.
std::vector<GameDBInfo> dbInfos;
if (tvVerified_ && g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
if (tvVerified_ && !info->id_version.empty() && g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
bool found = false;
for (auto &dbInfo : dbInfos) {
if (dbInfo.crc == crcVal) {
Expand All @@ -368,7 +368,7 @@ ScreenRenderFlags GameScreen::render(ScreenRenderMode mode) {
GameDBInfo dbInfo;
if (tvVerified_) {
std::vector<GameDBInfo> dbInfos;
if (!g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
if (!info->id_version.empty() && !g_gameDB.GetGameInfos(info->id_version, &dbInfos)) {
// tvVerified_->SetText(ga->T("Game ID unknown - not in the ReDump database"));
// tvVerified_->SetVisibility(UI::V_VISIBLE);
// tvVerified_->SetLevel(NoticeLevel::WARN);
Expand Down

0 comments on commit 15db280

Please sign in to comment.