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 --- testing/resources/pixel/bug_845697.in | 63 +++++++++++++++++++++ .../resources/pixel/bug_845697_expected.pdf.0.png | Bin 0 -> 2348 bytes 2 files changed, 63 insertions(+) create mode 100644 testing/resources/pixel/bug_845697.in create mode 100644 testing/resources/pixel/bug_845697_expected.pdf.0.png (limited to 'testing/resources') diff --git a/testing/resources/pixel/bug_845697.in b/testing/resources/pixel/bug_845697.in new file mode 100644 index 0000000000..92da761d40 --- /dev/null +++ b/testing/resources/pixel/bug_845697.in @@ -0,0 +1,63 @@ +{{header}} +{{object 1 0}} << + /Type /Catalog + /Pages 2 0 R +>> +endobj +{{object 2 0}} << + /Type /Pages + /MediaBox [ 0 0 200 200 ] + /Count 1 + /Kids [ 3 0 R ] +>> +endobj +{{object 3 0}} << + /Type /Page + /Parent 2 0 R + /Resources << + /Font << + /F1 4 0 R + >> + >> + /Contents 6 0 R +>> +endobj +{{object 4 0}} << + /Type /Font + /Subtype /TrueType + /BaseFont /ABCDEE+Calibri + /Encoding /WinAnsiEncoding + /FirstChar 65 + /LastChar 74 + /FontDescriptor 5 0 R + /Name /F1 + /Widths [300 250 250 250 250 250 250 250 250] +>> +endobj +{{object 5 0}} << + /Type /FontDescriptor + /CapHeight 750 + /Descent -250 + /Flags 32 + /FontBBox [ -503 -250 1240 750 ] + /FontName /ABCDEE+Calibri + /FontWeight 400 + /ItalicAngle 0 + /StemV 52 +>> +endobj +{{object 6 0}} << + {{streamlen}} +>> +stream +BT +50 100 Td +/F1 20 Tf +(ABCDEFGHI) Tj +ET +endstream +endobj +{{xref}} +{{trailer}} +{{startxref}} +%%EOF diff --git a/testing/resources/pixel/bug_845697_expected.pdf.0.png b/testing/resources/pixel/bug_845697_expected.pdf.0.png new file mode 100644 index 0000000000..a55063cde5 Binary files /dev/null and b/testing/resources/pixel/bug_845697_expected.pdf.0.png differ -- cgit v1.2.3