mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +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
|
//Paint Text Background
|
||||||
if (m_nPaintBackground){
|
if (m_nPaintBackground){
|
||||||
if (m_bgpixbuf)
|
if (m_bgpixbuf){
|
||||||
delete[] m_bgpixbuf;
|
delete[] m_bgpixbuf;
|
||||||
m_bgpixbuf = NULL;
|
m_bgpixbuf = NULL;
|
||||||
|
}
|
||||||
frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType);
|
frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType);
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
frameBuffer->RestoreScreen(ax, ay, dx, dy, m_bgpixbuf);
|
if (m_bgpixbuf)
|
||||||
|
frameBuffer->RestoreScreen(ax, ay, dx, dy, m_bgpixbuf);
|
||||||
|
}
|
||||||
|
|
||||||
if( m_nNrOfLines <= 0)
|
if( m_nNrOfLines <= 0)
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user