[MPlayer-dev-eng] [PATCH] Problems with invalid font.desc

Sascha Sommer saschasommer at freenet.de
Sun Jul 11 14:45:04 CEST 2004


On Thursday 01 July 2004 11:55, Daniel von Dincklage wrote:
> Hi,
>
> there seem to be some bugs in the loading of the fonts
> if the font.desc file does not contain the expected
> values. These bugs will cause a crash in sub.c, line 610
> as they cause the font member of the vo-font-structure
> not to be initialized, thus still containing -1.
>
> a) If  no content in the descfile the fgets() loop in font_load.c
>  will never be executed, the error therefore never be detected
>  and a successful load assumed.
>  (See patch 1)

Applied.

> b) There also seems to be a bug that, if one of these situations
> appears hafter having fixed the bug, mplayer tries to use the
> OSD font for the subtitles
> (Path
>  sub.:777 -> load_font_ft
>  	(As no font, and we are trying with a font...)
>  font_load_ft.c:1159 ->  read_font_desc_ft
>  	(font_fontconfig == 0)
>  This function tries to load the subtitle font (with the
>  name ""), fails, and proceeds loading the OSD-Font instead.
>  The latter function returns the font structure of the OSD-Font,
>  which then is entered as vo_font, and then indexed in the
>  font structure while displaying the subtitles, which yields -1,
>  and subsequently causes a crash.)
>  (See patch 2)

Not applied. I'm not sure but the goto might be there for a reason.
Instead it checks in vo_update_text_sub now if the subtitle font
is initalized or not.

>  [By its own, the patch will cause a repeated message indicating
>   the error each time the osd is upated; probably one should move
>   the load_font_ft out of vo_update_osd]

Another reason for not applying the above patch. Missing fonts
should only give 1 warning as they are not necessary for playback.
Also note that the osd status bar still works when we keep the goto.

> c) If the font.desc has a syntax error, mplayer will display
>  a message, but will continue nevertheless even though the
>  font structure is bogus. (See patch 3)

Applied.

Sascha




More information about the MPlayer-dev-eng mailing list