diff --git a/Common/UI/IconCache.cpp b/Common/UI/IconCache.cpp index 9c53aebad0ed..f5b28881a0c2 100644 --- a/Common/UI/IconCache.cpp +++ b/Common/UI/IconCache.cpp @@ -91,7 +91,11 @@ bool IconCache::LoadFromFile(FILE *file) { std::string data; data.resize(entryHeader.dataLen); - fread(&data[0], 1, entryHeader.dataLen, file); + size_t len = fread(&data[0], 1, entryHeader.dataLen, file); + if (len != (size_t)entryHeader.dataLen) { + // Stop reading and don't use this entry. Seems the file is truncated, but we'll recover. + break; + } Entry entry{}; entry.data = data; diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index a967ece119c5..19a1224bc0d5 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -506,6 +506,9 @@ static void DoFrameIdleTiming() { void hleEnterVblank(u64 userdata, int cyclesLate) { int vbCount = userdata; + // This should be a good place to do it. Should happen once per vblank. Here or in leave? Not sure it matters much. + Achievements::FrameUpdate(); + VERBOSE_LOG(SCEDISPLAY, "Enter VBlank %i", vbCount); DisplayFireVblankStart(); diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index f0be5ed6bd73..e01fa44f55f2 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1146,8 +1146,6 @@ void EmuScreen::update() { } } } - - Achievements::FrameUpdate(); } void EmuScreen::checkPowerDown() {