From aac59a0e59052366e260396165a759b5b0e80188 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 22 Aug 2017 11:24:17 -0400 Subject: Check length in CFX_Win32FontInfo::AddInstalledFont MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL is a tentative fix for the bug below. The last method in the stack trace is FontEnumProc, which calls AddInstalledFont. This problem was introduced by https://pdfium-review.googlesource.com/c/pdfium/+/10651 Bug: chromium:757388 Change-Id: If089a43367f1106a79276f6b09b6d0546b863e35 Reviewed-on: https://pdfium-review.googlesource.com/11611 Reviewed-by: Ryan Harrison Commit-Queue: Nicolás Peña --- core/fxge/win32/fx_win32_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/fxge') diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index 101c945fc5..5f778f8965 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -430,7 +430,7 @@ bool CFX_Win32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) { void CFX_Win32FontInfo::AddInstalledFont(const LOGFONTA* plf, uint32_t FontType) { CFX_ByteString name(plf->lfFaceName); - if (name[0] == '@') + if (name.GetLength() > 0 && name[0] == '@') return; if (name == m_LastFamily) { -- cgit v1.2.3