CTextBox: ensure save screen only if dimensions are valid

0 values are critical


Origin commit data
------------------
Commit: 87cbb564a3
Author: Thilo Graf <dbt@novatux.de>
Date: 2015-04-13 (Mon, 13 Apr 2015)
This commit is contained in:
2015-04-13 10:37:45 +02:00
committed by vanhofen
parent 7ad7b09de3
commit 1204dc95f7

View File

@@ -579,8 +579,10 @@ void CTextBox::refreshText(void)
if (!m_nPaintBackground && m_SaveScreen) {
if (m_bgpixbuf == NULL){
//TRACE("[CTextBox] %s save bg %d\r\n", __FUNCTION__, __LINE__);
m_bgpixbuf= new fb_pixel_t[dx * dy];
frameBuffer->SaveScreen(ax, ay, dx, dy, m_bgpixbuf);
if ((dx * dy) >0){
m_bgpixbuf= new fb_pixel_t[dx * dy];
frameBuffer->SaveScreen(ax, ay, dx, dy, m_bgpixbuf);
}
}
}