From e8556738026db4594d03225eece980b5436e21df Mon Sep 17 00:00:00 2001 From: Megamouse Date: Fri, 18 Dec 2020 01:17:27 +0100 Subject: [PATCH] memory viewer: check width and height in image viewer --- rpcs3/rpcs3qt/memory_viewer_panel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rpcs3/rpcs3qt/memory_viewer_panel.cpp b/rpcs3/rpcs3qt/memory_viewer_panel.cpp index a67d5e5e3b..7c4cedd397 100644 --- a/rpcs3/rpcs3qt/memory_viewer_panel.cpp +++ b/rpcs3/rpcs3qt/memory_viewer_panel.cpp @@ -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) { + if (width == 0 || height == 0) + { + return; + } + std::shared_lock rlock(vm::g_mutex); 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(); // Flip vertically - if (flipv) + if (flipv && height > 1) { const u32 pitch = width * 4; for (u32 y = 0; y < height / 2; y++)