mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
CTextBox: ensure restore of background, if pixbuf exists
This may prevent undefined behavior or even possible segfaults
This commit is contained in:
@@ -525,13 +525,16 @@ void CTextBox::refreshText(void)
|
||||
|
||||
//Paint Text Background
|
||||
if (m_nPaintBackground){
|
||||
if (m_bgpixbuf)
|
||||
if (m_bgpixbuf){
|
||||
delete[] m_bgpixbuf;
|
||||
m_bgpixbuf = NULL;
|
||||
m_bgpixbuf = NULL;
|
||||
}
|
||||
frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType);
|
||||
}
|
||||
else
|
||||
frameBuffer->RestoreScreen(ax, ay, dx, dy, m_bgpixbuf);
|
||||
else{
|
||||
if (m_bgpixbuf)
|
||||
frameBuffer->RestoreScreen(ax, ay, dx, dy, m_bgpixbuf);
|
||||
}
|
||||
|
||||
if( m_nNrOfLines <= 0)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user