[vlc-devel] [PATCH] FreeType: Create() must lock before calling non-thread-safe FontContfig.

Jérôme Forissier jerome at taodyne.com
Thu Jan 31 11:26:51 CET 2013

On 31 janv. 2013, at 10:24, Rémi Denis-Courmont wrote:

> On Thu, 31 Jan 2013 09:41:33 +0100, Jerome Forissier <jerome at taodyne.com>
> wrote:
>> Fixes frequent crashes observed when starting simultaneous playback of
>> several videos.
> Firstly, FontConfig is also used from RenderCommon(), not only from
> Create(). So I doubt your patch really protects against unsafe use of old
> FontConfig versions within VLC.

Agreed. I was just dealing with a case where (AFAICT) FontConfig is never used in the app, except by Create() in the freetype plugin.

> Secondly, a static lock in VLC will never be sufficient. FontConfig can
> also be used from other threads from non-VLC code, and it often is so. In
> particular, a number of UI frameworks on Linux/BSD call FontConfig
> internally. Such crashes have been observed at times.
> So it seems to be the proper fix consists of requiring a thread-safe
> version of FontConfig, i.e. 2.10.91 or later.

I incorrectly thought that thread-safety in FontConfig was still work in progress. Thanks for pointing me to this version, it  fixes the crash with my test case.
The next crash is in libfribidi 0.19.2-1, but I don't care because it is not reproducible when I pass --no-video-title-show to LibVLC.

Thanks again for your help.


More information about the vlc-devel mailing list