summaryrefslogtreecommitdiff
path: root/core/fxge/win32
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-08-22 11:24:17 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-22 16:02:46 +0000
commitaac59a0e59052366e260396165a759b5b0e80188 (patch)
treeb712d2cc56b7df68ea495966bfbe2918d124065b /core/fxge/win32
parente6f3fccc1c8c90867e0d779bf26337a0db1b1e90 (diff)
downloadpdfium-aac59a0e59052366e260396165a759b5b0e80188.tar.xz
Check length in CFX_Win32FontInfo::AddInstalledFont
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 <rharrison@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxge/win32')
-rw-r--r--core/fxge/win32/fx_win32_device.cpp2
1 files changed, 1 insertions, 1 deletions
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) {