Remove FPDFPageObj_Destroy() calls in fpdf_edit_embeddertest.cpp [pdfium : main]

0 views
Skip to first unread message

Andy Phan (Gerrit)

unread,
Mar 12, 2026, 6:48:16 PM (5 days ago) Mar 12
to Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com
Attention needed from Lei Zhang

Andy Phan added 2 comments

File fpdfsdk/fpdf_edit_embeddertest.cpp
Line 1347, Patchset 1 (Latest): ScopedFPDFPageObject page_object_deleter(page_object);
Andy Phan . unresolved

On a similar note, should this line occur after the FPDFPage_RemoveObject call? And should it be changed to ASSERT_TRUE?

Line 2232, Patchset 1 (Latest): // Not calling release() since ownership will be returned below in the
Andy Phan . unresolved

Is this a little more dangerous? Could there be a double free possible on test failure?

Open in Gerrit

Related details

Attention is currently required from:
  • Lei Zhang
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I6d796baddd2c415fcbed9613e4f6f0162fb25d01
Gerrit-Change-Number: 144753
Gerrit-PatchSet: 1
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Thu, 12 Mar 2026 22:48:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Mar 12, 2026, 7:30:54 PM (5 days ago) Mar 12
to Lei Zhang, Andy Phan, Pdfium LUCI CQ, pdfium-...@googlegroups.com
Attention needed from Andy Phan

Lei Zhang added 2 comments

File fpdfsdk/fpdf_edit_embeddertest.cpp
Line 1347, Patchset 1: ScopedFPDFPageObject page_object_deleter(page_object);
Andy Phan . resolved

On a similar note, should this line occur after the FPDFPage_RemoveObject call? And should it be changed to ASSERT_TRUE?

Lei Zhang

The only ways for FPDFPage_RemoveObject() to fail here are:

1) `page` is invalid, but that shouldn't happen and the test would probably have failed or crashed before getting here.
2) `page_object` is null. In which case, there's no chance of a double free.

Line 2232, Patchset 1: // Not calling release() since ownership will be returned below in the
Andy Phan . resolved

Is this a little more dangerous? Could there be a double free possible on test failure?

Lei Zhang

There's no ASSERT_FOO() call between here and line 2243, but I can release() here.

Open in Gerrit

Related details

Attention is currently required from:
  • Andy Phan
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: I6d796baddd2c415fcbed9613e4f6f0162fb25d01
    Gerrit-Change-Number: 144753
    Gerrit-PatchSet: 3
    Gerrit-Owner: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Attention: Andy Phan <andy...@chromium.org>
    Gerrit-Comment-Date: Thu, 12 Mar 2026 23:30:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Andy Phan <andy...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andy Phan (Gerrit)

    unread,
    Mar 12, 2026, 7:37:42 PM (5 days ago) Mar 12
    to Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com
    Attention needed from Lei Zhang

    Andy Phan voted and added 1 comment

    Votes added by Andy Phan

    Code-Review+1

    1 comment

    File fpdfsdk/fpdf_edit_embeddertest.cpp
    Line 1347, Patchset 1: ScopedFPDFPageObject page_object_deleter(page_object);
    Andy Phan . resolved

    On a similar note, should this line occur after the FPDFPage_RemoveObject call? And should it be changed to ASSERT_TRUE?

    Lei Zhang

    The only ways for FPDFPage_RemoveObject() to fail here are:

    1) `page` is invalid, but that shouldn't happen and the test would probably have failed or crashed before getting here.
    2) `page_object` is null. In which case, there's no chance of a double free.

    Andy Phan

    Ack

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lei Zhang
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: I6d796baddd2c415fcbed9613e4f6f0162fb25d01
    Gerrit-Change-Number: 144753
    Gerrit-PatchSet: 3
    Gerrit-Owner: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Attention: Lei Zhang <the...@chromium.org>
    Gerrit-Comment-Date: Thu, 12 Mar 2026 23:37:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
    Comment-In-Reply-To: Andy Phan <andy...@chromium.org>
    satisfied_requirement
    open
    diffy

    Pdfium LUCI CQ (Gerrit)

    unread,
    Mar 12, 2026, 7:52:26 PM (5 days ago) Mar 12
    to Lei Zhang, Andy Phan, pdfium-...@googlegroups.com

    Pdfium LUCI CQ submitted the change

    Change information

    Commit message:
    Remove FPDFPageObj_Destroy() calls in fpdf_edit_embeddertest.cpp

    Use ScopedFPDFPageObject instead.
    Change-Id: I6d796baddd2c415fcbed9613e4f6f0162fb25d01
    Commit-Queue: Lei Zhang <the...@chromium.org>
    Reviewed-by: Andy Phan <andy...@chromium.org>
    Files:
    • M fpdfsdk/fpdf_edit_embeddertest.cpp
    Change size: M
    Delta: 1 file changed, 87 insertions(+), 78 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Andy Phan
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: I6d796baddd2c415fcbed9613e4f6f0162fb25d01
    Gerrit-Change-Number: 144753
    Gerrit-PatchSet: 4
    Gerrit-Owner: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages