Be stricter about CFX_StandarFont::Index. [pdfium : main]

0 views
Skip to first unread message

Tom Sepez (Gerrit)

unread,
Jun 24, 2026, 8:38:32 PM (6 hours ago) Jun 24
to Lei Zhang, pdfium-...@googlegroups.com
Attention needed from Lei Zhang

New activity on the change

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 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: Ic5991b767f3429e8869915ebe557f896aa6e3d86
Gerrit-Change-Number: 150830
Gerrit-PatchSet: 2
Gerrit-Owner: Tom Sepez <tse...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Jun 2026 00:38:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Jun 24, 2026, 8:48:45 PM (6 hours ago) Jun 24
to Tom Sepez, Lei Zhang, pdfium-...@googlegroups.com
Attention needed from Tom Sepez

Lei Zhang voted and added 1 comment

Votes added by Lei Zhang

Code-Review+1

1 comment

File core/fxge/cfx_fontmapper.cpp
Line 236, Patchset 2 (Latest): return static_cast<CFX_StandardFont::Index>(base_int);
Lei Zhang . unresolved

I believe it does not go out of range, but maybe this should have a check to make sure it's casting to a valid enum value.

Open in Gerrit

Related details

Attention is currently required from:
  • Tom Sepez
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • 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: Ic5991b767f3429e8869915ebe557f896aa6e3d86
Gerrit-Change-Number: 150830
Gerrit-PatchSet: 2
Gerrit-Owner: Tom Sepez <tse...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Tom Sepez <tse...@chromium.org>
Gerrit-Comment-Date: Thu, 25 Jun 2026 00:48:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Tom Sepez (Gerrit)

unread,
Jun 24, 2026, 9:08:55 PM (5 hours ago) Jun 24
to Lei Zhang, pdfium-...@googlegroups.com

Tom Sepez added 2 comments

Patchset-level comments
File-level comment, Patchset 2:
Tom Sepez . resolved

Let me know if you like ps2 better.

File core/fxge/cfx_fontmapper.cpp
Line 236, Patchset 2: return static_cast<CFX_StandardFont::Index>(base_int);
Lei Zhang . resolved

I believe it does not go out of range, but maybe this should have a check to make sure it's casting to a valid enum value.

Tom Sepez

Wrote better logic.

Open in Gerrit

Related details

Attention set is empty
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: Ic5991b767f3429e8869915ebe557f896aa6e3d86
    Gerrit-Change-Number: 150830
    Gerrit-PatchSet: 2
    Gerrit-Owner: Tom Sepez <tse...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Comment-Date: Thu, 25 Jun 2026 01:08:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
    satisfied_requirement
    open
    diffy

    Tom Sepez (Gerrit)

    unread,
    Jun 24, 2026, 9:09:17 PM (5 hours ago) Jun 24
    to Lei Zhang, pdfium-...@googlegroups.com

    Tom Sepez added 1 comment

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    Tom Sepez . resolved

    ps3 that is

    Open in Gerrit

    Related details

    Attention set is empty
    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: Ic5991b767f3429e8869915ebe557f896aa6e3d86
    Gerrit-Change-Number: 150830
    Gerrit-PatchSet: 3
    Gerrit-Owner: Tom Sepez <tse...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Comment-Date: Thu, 25 Jun 2026 01:09:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Lei Zhang (Gerrit)

    unread,
    Jun 24, 2026, 9:17:21 PM (5 hours ago) Jun 24
    to Tom Sepez, Lei Zhang, pdfium-...@googlegroups.com
    Attention needed from Tom Sepez

    Lei Zhang voted and added 1 comment

    Votes added by Lei Zhang

    Code-Review+1

    1 comment

    File core/fxge/cfx_fontmapper.cpp
    Line 195, Patchset 3 (Latest): int pos = base_font % 4;
    Lei Zhang . unresolved

    Doesn't this always end up being 0 now, since IsStylableBaseFont() says the only valid values are 0, 4, and 8?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Tom Sepez
    Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • 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: Ic5991b767f3429e8869915ebe557f896aa6e3d86
      Gerrit-Change-Number: 150830
      Gerrit-PatchSet: 3
      Gerrit-Owner: Tom Sepez <tse...@chromium.org>
      Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
      Gerrit-Attention: Tom Sepez <tse...@chromium.org>
      Gerrit-Comment-Date: Thu, 25 Jun 2026 01:17:15 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages