mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Add some sanity checks guided by Android crash reports
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
ZipFileLoader::ZipFileLoader(FileLoader *sourceLoader)
|
||||
: ProxiedFileLoader(sourceLoader), zipArchive_(nullptr) {
|
||||
if (!backend_ || !backend_->Exists() || backend_->IsDirectory()) {
|
||||
// bad
|
||||
return;
|
||||
}
|
||||
|
||||
zip_error_t error{};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
}
|
||||
|
||||
void FlushSkin() {
|
||||
if (dec_->skinInDecode) {
|
||||
if (dec_ && dec_->skinInDecode) {
|
||||
FlushPartialDecode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user