Bug 1460543 - Check for null (default) style parameter in gfxDWriteFontEntry::CreateFontFace before dereferencing it. r=jwatt

This commit is contained in:
Jonathan Kew 2018-05-10 14:45:19 +01:00
Родитель 9520a60bbd
Коммит 47a41be37b
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -783,9 +783,10 @@ gfxDWriteFontEntry::CreateFontFace(IDWriteFontFace **aFontFace,
AutoTArray<DWRITE_FONT_AXIS_VALUE, 4> fontAxisValues;
// Get the variation settings needed to instantiate the fontEntry
// for a particular fontStyle.
// for a particular fontStyle, or use default style if no aFontStyle
// was passed (e.g. instantiating a face just to read font tables).
AutoTArray<gfxFontVariation,4> vars;
GetVariationsForStyle(vars, *aFontStyle);
GetVariationsForStyle(vars, aFontStyle ? *aFontStyle : gfxFontStyle());
// Copy variation settings to DWrite's type.
if (!vars.IsEmpty()) {