[MPlayer-dev-eng] [PATCH] Fix fontconfig crash when it can't find a config directory

Adrian Stutz adrian at sttz.ch
Wed Dec 16 23:43:11 CET 2009


On Wed, Dec 16, 2009 at 10:38 PM, Uoti Urpala <uoti.urpala at pp1.inet.fi>wrote:

> The patch you applied looks suspicious by itself - the code obviously
> did not _always_ crash without that patch, which means that either
> fontconfig does not always write through the pointer or some of those
> writes check against NULL but others don't. Given that, your change
> certainly doesn't look safe.
>

Yes, I did wrongfully assume fontconfig would initialize the result variable
and should have noticed that isn't the case based on the fact that it only
crashes on an error.


> Can you give the call a dummy pointer and check against the return value
> being NULL instead? (To me it looks like this should be a more robust
> check, but I didn't check the semantics carefully enough to be fully
> certain it's correct.)
>

You're right. Fixed accordingly.

You also left invalid indentation in the file, you should fix that.
>

The file didn't look correctly indented but now I realize the tabs are
supposed to be 8 spaces wide while soft-tabs are 4 spaces wide (with some
lines being indeted 1.5 tabs: one 8-space tab plus one 4-space soft-tab).

How do I ident validly in this case? Follow the inane style of the file,
ident the current function with 4-space soft-tabs or fix the whole file?

Greetings,
Adrian



More information about the MPlayer-dev-eng mailing list