From 8f7ee98e2c622c21f452cd9fd5956fe85bcb2b7c Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Thu, 31 May 2018 00:32:14 +0000 Subject: Fix font regression in AdjustMMParams MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 2334660 changed the |dest_width| in CFX_Font::AdjustMMParams to unsigned, but this means that dest_width - min_width becomes unsigned, which is wrong because the subtraction could be negative. This CL fixes this bug. Bug: chromium:845697 Change-Id: I88fb2f3ee3837d80ff5fa70a08309d9e0fec50e0 Reviewed-on: https://pdfium-review.googlesource.com/33150 Commit-Queue: Nicolás Peña Moreno Reviewed-by: Tom Sepez Reviewed-by: Lei Zhang --- core/fxge/cfx_font.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/fxge/cfx_font.cpp') diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp index 4634b87ac7..d04fc0dac0 100644 --- a/core/fxge/cfx_font.cpp +++ b/core/fxge/cfx_font.cpp @@ -501,8 +501,9 @@ void CFX_Font::ClearFaceCache() { } void CFX_Font::AdjustMMParams(int glyph_index, - uint32_t dest_width, + int dest_width, int weight) const { + ASSERT(dest_width >= 0); FXFT_MM_Var pMasters = nullptr; FXFT_Get_MM_Var(m_Face, &pMasters); if (!pMasters) -- cgit v1.2.3