From 59178f5b6e64c6c30545f1fd1ee6974eaa1356fc Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 16 Aug 2017 14:27:11 -0400 Subject: Fix another unguarded string element access BUG=chromium:754969 Change-Id: I4f92d301499c658c57393fde01f1252ea84e59a8 Reviewed-on: https://pdfium-review.googlesource.com/11250 Reviewed-by: Henrique Nakashima Commit-Queue: Ryan Harrison --- core/fxge/cfx_fontmapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp index b8ffe047a3..005c61ae8a 100644 --- a/core/fxge/cfx_fontmapper.cpp +++ b/core/fxge/cfx_fontmapper.cpp @@ -431,7 +431,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, } CFX_ByteString SubstName = name; SubstName.Remove(' '); - if (bTrueType && name[0] == '@') + if (bTrueType && name.GetLength() > 0 && name[0] == '@') SubstName = name.Right(name.GetLength() - 1); PDF_GetStandardFontName(&SubstName); if (SubstName == "Symbol" && !bTrueType) { -- cgit v1.2.3