mirror of
https://github.com/holub/mame
synced 2025-07-01 08:18:59 +03:00
osdcore: fix buffer overflow with osd_output stack
This commit is contained in:
parent
cee44b0414
commit
c6993affc6
@ -26,7 +26,7 @@ static int m_ptr = -1;
|
|||||||
|
|
||||||
void osd_output::push(osd_output *delegate)
|
void osd_output::push(osd_output *delegate)
|
||||||
{
|
{
|
||||||
if (m_ptr < MAXSTACK)
|
if (m_ptr < MAXSTACK - 1)
|
||||||
{
|
{
|
||||||
delegate->m_chain = (m_ptr >= 0 ? m_stack[m_ptr] : nullptr);
|
delegate->m_chain = (m_ptr >= 0 ? m_stack[m_ptr] : nullptr);
|
||||||
m_ptr++;
|
m_ptr++;
|
||||||
@ -37,7 +37,7 @@ void osd_output::push(osd_output *delegate)
|
|||||||
void osd_output::pop(osd_output *delegate)
|
void osd_output::pop(osd_output *delegate)
|
||||||
{
|
{
|
||||||
int f = -1;
|
int f = -1;
|
||||||
for (int i=0; i<=m_ptr; i++)
|
for (int i = 0; i <= m_ptr; i++)
|
||||||
if (m_stack[i] == delegate)
|
if (m_stack[i] == delegate)
|
||||||
{
|
{
|
||||||
f = i;
|
f = i;
|
||||||
|
Loading…
Reference in New Issue
Block a user