chore: cherry-pick 7f0bb5197ed1 from pdfium (#35792)

* chore: cherry-pick 7f0bb5197ed1 from pdfium

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Electron Bot <electron@github.com>
This commit is contained in:
Pedro Pontes
2022-09-24 11:05:46 +02:00
committed by GitHub
parent a01dbea645
commit d5c04c95a5
2 changed files with 31 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
cherry-pick-3466cc056b05.patch
cherry-pick-7f0bb5197ed1.patch
cherry-pick-497f077a1d46.patch

View File

@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tom Sepez <tsepez@chromium.org>
Date: Thu, 8 Sep 2022 23:45:54 +0000
Subject: Avoid de-referencing end() in GetNextAvailContentHeight().
Add the same HasCurrentViewRecord() check as in other methods.
Bug: chromium:1355682
Change-Id: I466f386f037801daa82ead30239f34e025748748
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/96910
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
(cherry picked from commit 0d76a139d7ffbbdfb0ef5f5e714597a25f9767c4)
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/97738
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fxfa/layout/cxfa_viewlayoutprocessor.cpp b/xfa/fxfa/layout/cxfa_viewlayoutprocessor.cpp
index 086e02d686d9fcabea6c3320ce515ae5180b6443..a92c1dfbea9684c9258b9eef594b94f93af4f525 100644
--- a/xfa/fxfa/layout/cxfa_viewlayoutprocessor.cpp
+++ b/xfa/fxfa/layout/cxfa_viewlayoutprocessor.cpp
@@ -1550,6 +1550,8 @@ void CXFA_ViewLayoutProcessor::ProcessLastPageSet() {
}
bool CXFA_ViewLayoutProcessor::GetNextAvailContentHeight(float fChildHeight) {
+ if (!HasCurrentViewRecord())
+ return false;
CXFA_Node* pCurContentNode =
GetCurrentViewRecord()->pCurContentArea->GetFormNode();
if (!pCurContentNode)