mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
memory viewer: check width and height in image viewer
This commit is contained in:
parent
112ac7bd13
commit
e855673802
@ -439,6 +439,11 @@ void memory_viewer_panel::SetPC(const uint pc)
|
|||||||
|
|
||||||
void memory_viewer_panel::ShowImage(QWidget* parent, u32 addr, color_format format, u32 width, u32 height, bool flipv)
|
void memory_viewer_panel::ShowImage(QWidget* parent, u32 addr, color_format format, u32 width, u32 height, bool flipv)
|
||||||
{
|
{
|
||||||
|
if (width == 0 || height == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_lock rlock(vm::g_mutex);
|
std::shared_lock rlock(vm::g_mutex);
|
||||||
|
|
||||||
if (!vm::check_addr(addr, 0, width * height * 4))
|
if (!vm::check_addr(addr, 0, width * height * 4))
|
||||||
@ -522,7 +527,7 @@ void memory_viewer_panel::ShowImage(QWidget* parent, u32 addr, color_format form
|
|||||||
rlock.unlock();
|
rlock.unlock();
|
||||||
|
|
||||||
// Flip vertically
|
// Flip vertically
|
||||||
if (flipv)
|
if (flipv && height > 1)
|
||||||
{
|
{
|
||||||
const u32 pitch = width * 4;
|
const u32 pitch = width * 4;
|
||||||
for (u32 y = 0; y < height / 2; y++)
|
for (u32 y = 0; y < height / 2; y++)
|
||||||
|
Loading…
Reference in New Issue
Block a user