|
Description
|
I encountered fontconfig core dump like the following on nv_b49
===
% ./fc-match monospace
zsh: segmentation fault (core dumped) ./fc-match monospace
% pstack core
core 'core' of 18655: ./fc-match monospace
fef710b9 FcHideFont (80668f8, 80caf78, 80caf60, 8047a0c) + b9
fef71642 FcFontSetMatch (80615e8, 8047b48, 1, 80e4a50, 8047b80) + 1c2
fef71ad2 FcFontMatch (80615e8, 80e4a50, 8047b80) + a2
08050d1f main (2, 8047bcc, 8047bd8) + 17f
08050a6a _start (2, 8047c94, 8047c9f, 0, 8047ca9, 8047cd5) + 7a
===
Since some rare font doesn't start alphabetical name,
pos value should be checked before accessing array. See comment.
===
static FcPattern *
FcHideFont ( FcHide *r,
FcPatternElt *pe,
FcPattern *fnt,
FcLangSet **pls )
{
FcPattern *new = fnt;
FcFontLang *fl;
if ( r && pe )
{
int pos = (int)(FcToLower(pe->values->value.u.s[0])) - 'a';
fl = r->az[pos];
===
Remove unnecessary information.
|