osdcore: fix buffer overflow with osd_output stack

This commit is contained in:
hap 2021-10-30 21:28:11 +02:00
parent cee44b0414
commit c6993affc6

View File

@ -26,7 +26,7 @@ static int m_ptr = -1;
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);
m_ptr++;