mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-03 03:03:50 +01:00
ManagedTexture: fix file buffer leak on failed image decode
TextureLoadTask::Run() only freed the VFS-read file buffer on the success path - a corrupt/truncated image in a texture pack or replacement texture directory (valid magic, bad payload) leaked the whole file's bytes on every load attempt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4QAoxV2KY7ek4PcZw3WvY
This commit is contained in:
1 parent
472ff6ac71
commit
ef87fe2e74
1 file changed
+2
-6
@@ -40,13 +40,9 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if (!tempImage_->LoadTextureLevelsFromFileData(buffer, fileSize, type_)) {
|
||||
*state_ = ManagedTexture::LoadState::FAILED;
|
||||
waitable_->Notify();
|
||||
return;
|
||||
}
|
||||
bool success = tempImage_->LoadTextureLevelsFromFileData(buffer, fileSize, type_);
|
||||
delete[] buffer;
|
||||
*state_ = ManagedTexture::LoadState::SUCCESS;
|
||||
*state_ = success ? ManagedTexture::LoadState::SUCCESS : ManagedTexture::LoadState::FAILED;
|
||||
waitable_->Notify();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user