Merge pull request #11875 from hrydgard/font-doublefree-callback-fix

sceFontLib: Don't call the callback if double-free.
This commit is contained in:
Henrik Rydgård 2019-03-11 13:40:19 +01:00 committed by GitHub
commit 238211f50a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -436,7 +436,9 @@ public:
}
u32 args[2] = { params_.userDataAddr, (u32)handle_ };
// TODO: The return value of this is leaking.
__KernelDirectMipsCall(params_.freeFuncAddr, 0, args, 2, false);
if (handle_) { // Avoid calling free-callback on double-free
__KernelDirectMipsCall(params_.freeFuncAddr, 0, args, 2, false);
}
handle_ = 0;
fonts_.clear();
isfontopen_.clear();