Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf files
authorJun Fang <jun_fang@foxitsoftware.com>
Sat, 26 Sep 2015 03:32:46 +0000 (20:32 -0700)
committerJun Fang <jun_fang@foxitsoftware.com>
Sat, 26 Sep 2015 03:32:46 +0000 (20:32 -0700)
commit9bd18183ba8210c91d71c3060146235750a4c71c
treee1950c29e9e295dd247a0edc5ed8d490e18800d8
parent163f59b9a0b019539e9a463ec183c964e7317d5b
Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf files

Pdfium swallows 'fi' or 'ff' in some tested files because it doesn't load the embedded font file correctly. The root cause is that there is incorrect keyword like 'ngendstream' in the stream of the embedded font file. Pdfium tries to find another correct keyword but uses wrong offset rather than accumulated offset.

BUG=524043
R=thestig@chromium.org, tsepez@chromium.org

Review URL: https://codereview.chromium.org/1307353005 .
19 files changed:
core/include/fpdfapi/fpdf_parser.h
core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
core/src/fpdfapi/fpdf_page/pageint.h
core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
testing/resources/pixel/bug_524043_1.in [new file with mode: 0644]
testing/resources/pixel/bug_524043_1_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/bug_524043_2.in [new file with mode: 0644]
testing/resources/pixel/bug_524043_2_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/bug_524043_3.in [new file with mode: 0644]
testing/resources/pixel/bug_524043_3_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/bug_524043_4.in [new file with mode: 0644]
testing/resources/pixel/bug_524043_4_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/bug_524043_5.in [new file with mode: 0644]
testing/resources/pixel/bug_524043_5_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/bug_524043_6.in [new file with mode: 0644]
testing/resources/pixel/bug_524043_6_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/bug_524043_7.in [new file with mode: 0644]
testing/resources/pixel/bug_524043_7_expected.pdf.0.png [new file with mode: 0644]