summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2021-10-29 16:12:34 +0200
committer hap <happppp@users.noreply.github.com>2021-10-29 16:12:34 +0200
commit41a80334ce442a42b4f62d64713534d9ad722145 (patch)
tree35cd5e5ea83bfbab66533deb4e286704c942afe6
parentd2aa062d94a15a990e4392999bd3580592b4b9cf (diff)
screen: fix buffer overflow crash with VIDEO_VARIABLE_WIDTH screens [AmatCoder]
-rw-r--r--src/emu/screen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp
index 0993473de49..e3ca74869f9 100644
--- a/src/emu/screen.cpp
+++ b/src/emu/screen.cpp
@@ -635,12 +635,12 @@ void screen_device::allocate_scan_bitmaps()
else
m_scan_bitmaps[j].push_back(new bitmap_rgb32(effwidth, 1));
}
- m_scan_widths.push_back(m_width);
+ m_scan_widths.push_back(effwidth);
}
}
else
{
- for (int i = effheight; i < old_height; i++)
+ for (int i = old_height - 1; i >= effheight; i--)
{
for (int j = 0; j < 2; j++)
{