Add some sanity checks guided by Android crash reports

This commit is contained in:
Henrik Rydgård
2025-06-07 16:35:19 +02:00
parent 61016b8555
commit 44d06ec42f
6 changed files with 11 additions and 9 deletions
+4 -2
View File
@@ -164,9 +164,11 @@ public:
void Cancel() {
std::lock_guard<std::mutex> guard(readyMutex_);
if (!ready_) {
_dbg_assert_(task_);
ready_ = true;
task_->Cancel();
_dbg_assert_(task_);
if (task_) {
task_->Cancel();
}
rx_->Release();
rx_ = nullptr;
}
+1 -1
View File
@@ -10,7 +10,7 @@
ZipFileLoader::ZipFileLoader(FileLoader *sourceLoader)
: ProxiedFileLoader(sourceLoader), zipArchive_(nullptr) {
if (!backend_ || !backend_->Exists() || backend_->IsDirectory()) {
// bad
return;
}
zip_error_t error{};
+3 -3
View File
@@ -1323,10 +1323,10 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load
bool insertSymbols = scan && !reader.LoadSymbols();
std::vector<SectionID> codeSections = reader.GetCodeSections();
for (SectionID id : codeSections) {
u32 start = reader.GetSectionAddr(id);
const u32 start = reader.GetSectionAddr(id);
// Note: scan end is inclusive.
u32 end = start + reader.GetSectionSize(id) - 4;
u32 len = end + 4 - start;
const u32 end = start + reader.GetSectionSize(id) - 4;
const u32 len = end + 4 - start;
if (len == 0) {
// Seen in WWE: Smackdown vs Raw 2009. See #17435.
continue;
+1 -1
View File
@@ -1023,7 +1023,7 @@ skip:
}
bool ScanForFunctions(u32 startAddr, u32 endAddr, bool insertSymbols) {
_assert_(((startAddr | endAddr) & 3) == 0);
_assert_((startAddr & 3) == 0);
std::lock_guard<std::recursive_mutex> guard(functions_lock);
+1 -1
View File
@@ -111,7 +111,7 @@ public:
}
void FlushSkin() {
if (dec_->skinInDecode) {
if (dec_ && dec_->skinInDecode) {
FlushPartialDecode();
}
}
+1 -1
View File
@@ -661,7 +661,7 @@ void SoftGPU::BeginHostFrame() {
}
bool SoftGPU::PresentedThisFrame() const {
return presentation_->PresentedThisFrame();
return presentation_ ? presentation_->PresentedThisFrame() : false;
}
void SoftGPU::MarkDirty(uint32_t addr, uint32_t stride, uint32_t height, GEBufferFormat fmt, SoftGPUVRAMDirty value) {