mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-22 04:25:19 +00:00
Utilities/Memory Viewer: Fix memory leak
This commit is contained in:
parent
137f37cd41
commit
87d5f45277
1 changed files with 7 additions and 1 deletions
|
@ -898,9 +898,15 @@ void memory_viewer_panel::ShowImage(QWidget* parent, u32 addr, color_format form
|
|||
}
|
||||
|
||||
const auto originalBuffer = static_cast<u8*>(this->to_ptr(addr, memsize));
|
||||
|
||||
if (!originalBuffer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const auto convertedBuffer = new (std::nothrow) u8[memsize];
|
||||
|
||||
if (!originalBuffer || !convertedBuffer)
|
||||
if (!convertedBuffer)
|
||||
{
|
||||
// OOM or invalid memory address, give up
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue