[MPlayer-dev-eng] [PATCH] Check add_face return value in ass_font.c (libass)

Evgeniy Stepanov eugeni.stepanov at gmail.com
Thu Oct 25 23:26:55 CEST 2007


On Thursday 25 October 2007 22:36:14 Dominik 'Rathann' Mierzejewski wrote:
> On Thursday, 25 October 2007 at 13:11, Glen Nakamura wrote:
> > The attached patch fixes a segmentation fault when add_face returns -1.
> > I left out the indentation fixes in accordance with the FAQ.
>
> Please explain in what situation add_face returns -1.

It can return -1 if either a font file is broken and could not be loaded, or  
ass_font_t object contains too many font faces. The latter can realistically 
happen if, for some reason, freetype and fontconfig have different views on 
which glyphs are present in some font. in this case libass will be opening 
the same font file until ASS_FONT_MAX_FACES is reached.

Patch applied.



More information about the MPlayer-dev-eng mailing list