mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 09:21:18 +02:00
fontrenderer.cpp: prevent possible crash when text parameter == NULL
Observed e.g. with undefined behavior within threads Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -469,6 +469,11 @@ void Font::paintFontPixel(fb_pixel_t *td, uint8_t src)
|
||||
|
||||
void Font::RenderString(int x, int y, const int width, const char *text, const fb_pixel_t color, const int boxheight, const unsigned int flags, fb_pixel_t *buffer, int _stride)
|
||||
{
|
||||
if (!text){
|
||||
dprintf(DEBUG_DEBUG,"\033[33m[Font] [%s - %d] ERROR! parameter text = [%p]\033[0m\n", __func__, __LINE__, text);
|
||||
return;
|
||||
}
|
||||
|
||||
bool render_to_fb = (buffer == NULL);
|
||||
if (render_to_fb && !frameBuffer->getActive())
|
||||
return;
|
||||
|
Reference in New Issue
Block a user