From 000d93c0d989b3ff2ee63fddb3fb4a405a3b247e Mon Sep 17 00:00:00 2001 From: Niels Elburg Date: Fri, 22 Dec 2006 13:02:47 +0000 Subject: [PATCH] First 0.9.9 fix, possible segfault in srt editor fixed git-svn-id: svn://code.dyne.org/veejay/trunk@738 eb8d1916-c9e9-0310-b8de-cf0c9472ead5 --- veejay-current/veejay/vj-font.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/veejay-current/veejay/vj-font.c b/veejay-current/veejay/vj-font.c index 457aad2c..8fdbacf2 100644 --- a/veejay-current/veejay/vj-font.c +++ b/veejay-current/veejay/vj-font.c @@ -1215,8 +1215,10 @@ static int configure(vj_font_t *f, int size, int font) f->current_font = font; f->font = select_font( f , font ); if(f->font == NULL ) + { + veejay_msg(VEEJAY_MSG_ERROR, "Selected font '%d' not available", font ); return 0; - + } if( f->face ) { for( c = 0; c < 256 ; c ++) @@ -1264,7 +1266,8 @@ static int configure(vj_font_t *f, int size, int font) } f->glyphs_index[c] = FT_Get_Char_Index( f->face, (unsigned char) c ); - FT_Glyph_Get_CBox( f->glyphs[ c ] , ft_glyph_bbox_pixels, &bbox); + if( f->glyphs_index[c] ) + FT_Glyph_Get_CBox( f->glyphs[ c ] , ft_glyph_bbox_pixels, &bbox); if( bbox.yMax > yMax ) yMax = bbox.yMax; @@ -1394,7 +1397,11 @@ static int get_default_font( vj_font_t *f ) if( f->font_list[i]) { if( strcasecmp( default_fonts[j].name, f->font_list[i] ) == 0 ) + { + veejay_msg(VEEJAY_MSG_DEBUG, "Using default font '%s'", + default_fonts[j].name ); return i; + } } } } @@ -2039,7 +2046,8 @@ void vj_font_render(void *ctx, void *_picture, long position) if( old_font != s->font || old_size != s->size ) if(!configure( f, s->size, s->font )) - configure( f, old_size, old_font ); + if(!configure( f, old_size, old_font )) + break; f->x = s->x; f->y = s->y;