Prevent crashing when FcFontList fails
FcFontList can return null pointer in failure cases which would lead to null pointer dereference further down. Pick-to: 5.15 6.2 6.3 Change-Id: I6b407cf2f27ead9eb471d3ee7a521468cebf7572 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
parent
d490501641
commit
691541023a
@ -593,6 +593,8 @@ void QFontconfigDatabase::populateFontDatabase()
|
||||
fonts = FcFontList(nullptr, pattern, os);
|
||||
FcObjectSetDestroy(os);
|
||||
FcPatternDestroy(pattern);
|
||||
if (!fonts)
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < fonts->nfont; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user