mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 15:02:50 +02:00
fontrenderer: improve freetype error handling
* freetype errors are != 0, not < 0, fix that to avoid segfaults in
case of invalid fonts
* unlock the render mutex in case of an error
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@42 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: 5345573e5e
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2009-12-13 (Sun, 13 Dec 2009)
Origin message was:
------------------
fontrenderer: improve freetype error handling
* freetype errors are != 0, not < 0, fix that to avoid segfaults in
case of invalid fonts
* unlock the render mutex in case of an error
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@42 e54a6e83-5905-42d5-8d5c-058d10e6a962
------------------
This commit was generated by Migit
This commit is contained in:
@@ -253,9 +253,10 @@ int Font::setSize(int isize)
|
|||||||
scaler.width = isize * 64;
|
scaler.width = isize * 64;
|
||||||
scaler.height = isize * 64;
|
scaler.height = isize * 64;
|
||||||
|
|
||||||
if (FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size)<0)
|
FT_Error err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
|
||||||
|
if (err != 0)
|
||||||
{
|
{
|
||||||
dprintf(DEBUG_NORMAL, "FTC_Manager_Lookup_Size failed!\n");
|
dprintf(DEBUG_NORMAL, "%s:FTC_Manager_LookupSize failed (0x%x)\n", __FUNCTION__, err);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
face = size->face;
|
face = size->face;
|
||||||
@@ -353,9 +354,11 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u
|
|||||||
|
|
||||||
pthread_mutex_lock( &renderer->render_mutex );
|
pthread_mutex_lock( &renderer->render_mutex );
|
||||||
|
|
||||||
if (FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size)<0)
|
FT_Error err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
|
||||||
|
if (err != 0)
|
||||||
{
|
{
|
||||||
dprintf(DEBUG_NORMAL, "FTC_Manager_Lookup_Size failed!\n");
|
dprintf(DEBUG_NORMAL, "%s:FTC_Manager_LookupSize failed (0x%x)\n", __FUNCTION__, err);
|
||||||
|
pthread_mutex_unlock(&renderer->render_mutex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
face = size->face;
|
face = size->face;
|
||||||
@@ -566,9 +569,11 @@ int Font::getRenderWidth(const char *text, const bool utf8_encoded)
|
|||||||
{
|
{
|
||||||
pthread_mutex_lock( &renderer->render_mutex );
|
pthread_mutex_lock( &renderer->render_mutex );
|
||||||
|
|
||||||
if (FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size)<0)
|
FT_Error err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
|
||||||
|
if (err != 0)
|
||||||
{
|
{
|
||||||
dprintf(DEBUG_NORMAL, "FTC_Manager_Lookup_Size failed!\n");
|
dprintf(DEBUG_NORMAL, "%s:FTC_Manager_LookupSize failed (0x%x)\n", __FUNCTION__, err);
|
||||||
|
pthread_mutex_unlock(&renderer->render_mutex);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
face = size->face;
|
face = size->face;
|
||||||
|
Reference in New Issue
Block a user