[MPlayer-cvslog] r23104 - trunk/libass/ass_render.c

Ismail Dönmez ismail at pardus.org.tr
Tue Apr 24 20:26:51 CEST 2007


On Tuesday 24 April 2007 21:21:43 Reimar Döffinger wrote:
> Hello,
>
> On Tue, Apr 24, 2007 at 07:36:03PM +0200, eugeni wrote:
> > Author: eugeni
> > Date: Tue Apr 24 19:36:03 2007
> > New Revision: 23104
> >
> > Log:
> > Do not use FT_Glyph_Copy with NULL glyphs.
> > Contrary to the docs, it leaves garbage in *target.
> >
> >
> > Modified:
> >    trunk/libass/ass_render.c
> >
> > Modified: trunk/libass/ass_render.c
> > =========================================================================
> >===== --- trunk/libass/ass_render.c	(original)
> > +++ trunk/libass/ass_render.c	Tue Apr 24 19:36:03 2007
> > @@ -1239,7 +1239,8 @@ static void get_outline_glyph(int symbol
> >  	val = cache_find_glyph(&key);
> >  	if (val) {
> >  		FT_Glyph_Copy(val->glyph, &info->glyph);
> > -		FT_Glyph_Copy(val->outline_glyph, &info->outline_glyph);
> > +		if (val->outline_glyph)
> > +			FT_Glyph_Copy(val->outline_glyph, &info->outline_glyph);
> >  		info->bbox = val->bbox_scaled;
> >  		info->advance.x = val->advance.x;
> >  		info->advance.y = val->advance.y;
> > @@ -1260,8 +1261,10 @@ static void get_outline_glyph(int symbol
> >  			}
> >  		}
> >
> > +		memset(&v, 0, sizeof(v));
> >  		FT_Glyph_Copy(info->glyph, &v.glyph);
> > -		FT_Glyph_Copy(info->outline_glyph, &v.outline_glyph);
> > +		if (info->outline_glyph)
> > +			FT_Glyph_Copy(info->outline_glyph, &v.outline_glyph);
>
> If only info->outline_glyph == 0 is the problem, why didn't you put the
> memset in the else, IMO that would make it clearer.
> And if it is only a problem because FT_Glyph_Copy, you might consider if
> it's a good idea to add something like
> // HACK: at least in freetype version ... FT_Glyph_Copy does not work as
> // specified for info->outline_glyph
> Otherwise someone looking at the code in three years will scratch his
> head and wonder why you did it that complicated (yes, svn log is there,
> but it will be buried very deep...).

Also can you please report this to Freetype developers please?



-- 
Life is a game, and if you aren't in it to win,
what the heck are you still doing here?

-- Linus Torvalds (talking about open source development)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-cvslog/attachments/20070424/65954c24/attachment.pgp>


More information about the MPlayer-cvslog mailing list