mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 00:41:09 +02:00
CTextBox: catching error if position has signed values
Wrong position assignments can trigger crash. Prevent segfaults.
Error log should indicate this.
Origin commit data
------------------
Branch: ni/coolstream
Commit: 459c120060
Author: Thilo Graf <dbt@novatux.de>
Date: 2015-03-19 (Thu, 19 Mar 2015)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
#endif
|
||||
|
||||
#include <global.h>
|
||||
|
||||
#include <system/debug.h>
|
||||
#include "textbox.h"
|
||||
#include <gui/widget/icons.h>
|
||||
|
||||
@@ -553,7 +553,7 @@ void CTextBox::refreshText(void)
|
||||
|
||||
//bg variables
|
||||
int ax = m_cFrameTextRel.iX+m_cFrame.iX;
|
||||
int ay = /*m_cFrameTextRel.iY+*/m_cFrame.iY;
|
||||
int ay = m_cFrameTextRel.iY+m_cFrame.iY;
|
||||
int dx = m_cFrameTextRel.iWidth;
|
||||
int dy = m_cFrameTextRel.iHeight;
|
||||
|
||||
@@ -569,6 +569,12 @@ void CTextBox::refreshText(void)
|
||||
}
|
||||
}
|
||||
|
||||
//detect corrupt position values
|
||||
if ((ax<=0) || (ay<=0)){
|
||||
dprintf(DEBUG_NORMAL, "\033[33m[CTextBox] [%s - %d] ERROR! position out of range: ax = %d, ay = %d, dx = %d, dy = %d\033[0m\n", __func__, __LINE__, ax, ay, dx, dy);
|
||||
return;
|
||||
}
|
||||
|
||||
//save screen only if no paint of background required
|
||||
if (!m_nPaintBackground && m_SaveScreen) {
|
||||
if (m_bgpixbuf == NULL){
|
||||
|
Reference in New Issue
Block a user