From 7d6538bd0b90b7da62322c3bb2b19bb14999b94f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 27 Jul 2013 01:05:00 -0700 Subject: [PATCH 1/2] Don't crash in DeviceLost before game init. --- UI/EmuScreen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index e359fe5f43..f69e86f7ad 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -548,5 +548,6 @@ void EmuScreen::render() { void EmuScreen::deviceLost() { ILOG("EmuScreen::deviceLost()"); - gpu->DeviceLost(); + if (gpu) + gpu->DeviceLost(); } From 3988a12801e018ba22045af19161cf3f81173abd Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 27 Jul 2013 01:16:01 -0700 Subject: [PATCH 2/2] Allow filenames like e.g. F:\ as dirs. --- Core/Loaders.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Loaders.cpp b/Core/Loaders.cpp index ec32f612d4..464100026a 100644 --- a/Core/Loaders.cpp +++ b/Core/Loaders.cpp @@ -29,12 +29,12 @@ // TODO : improve, look in the file more EmuFileType Identify_File(std::string &filename) { - if (filename.size() < 5) { + if (filename.size() == 0) { ERROR_LOG(LOADER, "invalid filename %s", filename.c_str()); return FILETYPE_ERROR; } - std::string extension = filename.substr(filename.size() - 4); + std::string extension = filename.size() >= 5 ? filename.substr(filename.size() - 4) : ""; if (!strcasecmp(extension.c_str(),".iso")) { return FILETYPE_PSP_ISO;