Commit f5c01eb7 authored by Nicolas Pena's avatar Nicolas Pena Committed by Commit Bot

Close a page after creating it

FPDFPage_New creates a FPDF_PAGE object and adds a page to the FPDF_DOCUMENT.
However, the FPDF_PAGE object needs to be deleted by calling FPDF_ClosePage.

Bug: 807953
Change-Id: Ib0d7ca46979f855c38a03cf114c20505d825e620
Reviewed-on: https://chromium-review.googlesource.com/897930Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534057}
parent e3b83b42
......@@ -2885,7 +2885,10 @@ void PDFiumEngine::AppendBlankPages(int num_pages) {
ConvertUnitDouble(page_rect.width(), kPixelsPerInch, kPointsPerInch);
double height_in_points =
ConvertUnitDouble(page_rect.height(), kPixelsPerInch, kPointsPerInch);
FPDFPage_New(doc_, i, width_in_points, height_in_points);
// Add a new page to the document, but delete the FPDF_PAGE object.
FPDF_PAGE temp_page =
FPDFPage_New(doc_, i, width_in_points, height_in_points);
FPDF_ClosePage(temp_page);
pages_.push_back(std::make_unique<PDFiumPage>(this, i, page_rect, true));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment