[image-decoders] Convert BMP image reader to use safe buffer operations [chromium/src : main]

0 views
Skip to first unread message

Ho Cheung (Gerrit)

unread,
Oct 14, 2025, 2:13:41 AM (yesterday) Oct 14
to Wan-Teh Chang, Chromium LUCI CQ, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org
Attention needed from Wan-Teh Chang

Ho Cheung added 1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Wan-Teh Chang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
Gerrit-Change-Number: 7037578
Gerrit-PatchSet: 3
Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
Gerrit-Reviewer: Ho Cheung <hoch...@chromium.org>
Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
Gerrit-Attention: Wan-Teh Chang <w...@google.com>
Gerrit-Comment-Date: Tue, 14 Oct 2025 06:12:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Wan-Teh Chang (Gerrit)

unread,
Oct 14, 2025, 2:51:31 PM (yesterday) Oct 14
to Ho Cheung, Wan-Teh Chang, Chromium LUCI CQ, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org
Attention needed from Ho Cheung

Wan-Teh Chang added 6 comments

Commit Message
Line 10, Patchset 3 (Latest):reader by migrating to modern C++ safe containers and operations.
Wan-Teh Chang . unresolved

Thanks for the CL. I am not familiar with `base::span`. Do you know of a Chrome developer who could be the primary reviewer?

In this first round of review, I have reviewed bmp_image_reader.h (completely) and only the last change to bmp_image_reader.cc,

File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
Line 352, Patchset 3 (Latest): std::array<uint32_t, 4> bit_masks_;
Wan-Teh Chang . unresolved

Is it also recommended to change a C array to `std::array`?

At least in this CL, this kind of change doesn't seem necessary, in the sense that it doesn't really make these arrays more secure.

Line 231, Patchset 3 (Latest): // of the return value, the caller won't read it.
Wan-Teh Chang . unresolved

Delete this comment. It explained why `pixel` wasn't initialized in the original code. The new code initializes `pixel` (to 0).

Line 230, Patchset 3 (Latest): // It doesn't matter that we never set the most significant byte
Wan-Teh Chang . resolved

This comment shows this code assumes the computer is little-endian. I found this assumption documented and checked in base/numerics/byte_conversions.h:

```
// Chromium only builds and runs on Little Endian machines.
static_assert(std::endian::native == std::endian::little);
```

Line 6, Patchset 3 (Parent):// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
Wan-Teh Chang . unresolved

Should we add this bug number to the `Bug:` line in the commit message?

File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.cc
Line 976, Patchset 3 (Latest): SetI(color_indexes[which]);
Wan-Teh Chang . unresolved

Here `color_indexes[which]` is safe because `which` can only take the values 0 and 1.

Is this kind of proof acceptable for removing the `UNSAFE_TODO` macro? Or do we need to add a `CHECK`?
```
+ CHECK_LT(which, color_indexes.size());
if (color_indexes[which] < color_table_.size()) {
SetI(color_indexes[which]);
```
Open in Gerrit

Related details

Attention is currently required from:
  • Ho Cheung
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
    Gerrit-Change-Number: 7037578
    Gerrit-PatchSet: 3
    Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
    Gerrit-Reviewer: Ho Cheung <hoch...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-Attention: Ho Cheung <hoch...@chromium.org>
    Gerrit-Comment-Date: Tue, 14 Oct 2025 18:50:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ho Cheung (Gerrit)

    unread,
    Oct 14, 2025, 10:58:13 PM (22 hours ago) Oct 14
    to Kent Tamura, Wan-Teh Chang, Chromium LUCI CQ, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org
    Attention needed from Kent Tamura and Wan-Teh Chang

    Ho Cheung voted and added 6 comments

    Votes added by Ho Cheung

    Commit-Queue+1

    6 comments

    Patchset-level comments
    File-level comment, Patchset 4 (Latest):
    Ho Cheung . resolved

    +tkent

    Hi, please take a look at this CL and all the discussion threads, thank you!

    Commit Message
    Line 10, Patchset 3:reader by migrating to modern C++ safe containers and operations.
    Wan-Teh Chang . resolved

    Thanks for the CL. I am not familiar with `base::span`. Do you know of a Chrome developer who could be the primary reviewer?

    In this first round of review, I have reviewed bmp_image_reader.h (completely) and only the last change to bmp_image_reader.cc,

    Ho Cheung

    Thank you for your review, I will add Kent Tamura to the list of reviewers later.

    File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
    Line 352, Patchset 3: std::array<uint32_t, 4> bit_masks_;
    Wan-Teh Chang . resolved

    Is it also recommended to change a C array to `std::array`?

    At least in this CL, this kind of change doesn't seem necessary, in the sense that it doesn't really make these arrays more secure.

    Ho Cheung

    If we don't convert C-style arrays to std::array, the clang plugin will consider them unsafe. For more information, please see:

    https://chromium.googlesource.com/chromium/src/+/main/docs/unsafe_buffers.md#use-of-std_array

    Line 231, Patchset 3: // of the return value, the caller won't read it.
    Wan-Teh Chang . resolved

    Delete this comment. It explained why `pixel` wasn't initialized in the original code. The new code initializes `pixel` (to 0).

    Ho Cheung

    Done

    Line 6, Patchset 3 (Parent):// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
    Wan-Teh Chang . resolved

    Should we add this bug number to the `Bug:` line in the commit message?

    Ho Cheung

    As mentioned in issue 451652367,

    ```
    This issue is a replacement for issue 351564777, which reached the update limit.

    ```

    So I chose to only include 451652367 in the commit message.

    File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.cc
    Line 976, Patchset 3: SetI(color_indexes[which]);
    Wan-Teh Chang . resolved

    Here `color_indexes[which]` is safe because `which` can only take the values 0 and 1.

    Is this kind of proof acceptable for removing the `UNSAFE_TODO` macro? Or do we need to add a `CHECK`?
    ```
    + CHECK_LT(which, color_indexes.size());
    if (color_indexes[which] < color_table_.size()) {
    SetI(color_indexes[which]);
    ```
    Ho Cheung

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kent Tamura
    • Wan-Teh Chang
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
      Gerrit-Change-Number: 7037578
      Gerrit-PatchSet: 4
      Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
      Gerrit-Reviewer: Ho Cheung <hoch...@chromium.org>
      Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
      Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
      Gerrit-Attention: Wan-Teh Chang <w...@google.com>
      Gerrit-Attention: Kent Tamura <tk...@chromium.org>
      Gerrit-Comment-Date: Wed, 15 Oct 2025 02:57:19 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Wan-Teh Chang <w...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kent Tamura (Gerrit)

      unread,
      Oct 14, 2025, 11:16:31 PM (22 hours ago) Oct 14
      to Ho Cheung, Kent Tamura, Wan-Teh Chang, Chromium LUCI CQ, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org
      Attention needed from Ho Cheung and Wan-Teh Chang

      Kent Tamura added 2 comments

      File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
      Line 232, Patchset 4 (Parent): // It doesn't matter that we never set the most significant byte

      // of the return value, the caller won't read it.
      uint32_t pixel;
      Kent Tamura . unresolved

      This comment is still helpful because it's weird to copy only 3 bytes into a uint32_t.

      File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.cc
      Line 975, Patchset 4 (Latest): CHECK_LT(which, color_indexes.size());
      Kent Tamura . unresolved

      This check is redundant because our std::array::operator[] contains it.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ho Cheung
      • Wan-Teh Chang
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not 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: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
        Gerrit-Change-Number: 7037578
        Gerrit-PatchSet: 4
        Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
        Gerrit-Reviewer: Ho Cheung <hoch...@chromium.org>
        Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
        Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
        Gerrit-Attention: Wan-Teh Chang <w...@google.com>
        Gerrit-Attention: Ho Cheung <hoch...@chromium.org>
        Gerrit-Comment-Date: Wed, 15 Oct 2025 03:14:53 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Ho Cheung (Gerrit)

        unread,
        Oct 14, 2025, 11:23:32 PM (22 hours ago) Oct 14
        to Kent Tamura, Wan-Teh Chang, Chromium LUCI CQ, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org
        Attention needed from Kent Tamura and Wan-Teh Chang

        Ho Cheung voted and added 3 comments

        Votes added by Ho Cheung

        Commit-Queue+1

        3 comments

        Patchset-level comments
        File-level comment, Patchset 5 (Latest):
        Ho Cheung . resolved

        ptal again

        File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
        Line 232, Patchset 4 (Parent): // It doesn't matter that we never set the most significant byte
        // of the return value, the caller won't read it.
        uint32_t pixel;
        Kent Tamura . resolved

        This comment is still helpful because it's weird to copy only 3 bytes into a uint32_t.

        Ho Cheung

        Done

        File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.cc
        Line 975, Patchset 4: CHECK_LT(which, color_indexes.size());
        Kent Tamura . resolved

        This check is redundant because our std::array::operator[] contains it.

        Ho Cheung

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kent Tamura
        • Wan-Teh Chang
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not 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: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
          Gerrit-Change-Number: 7037578
          Gerrit-PatchSet: 5
          Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
          Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
          Gerrit-Attention: Wan-Teh Chang <w...@google.com>
          Gerrit-Attention: Kent Tamura <tk...@chromium.org>
          Gerrit-Comment-Date: Wed, 15 Oct 2025 03:22:40 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Kent Tamura <tk...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Kent Tamura (Gerrit)

          unread,
          12:12 AM (21 hours ago) 12:12 AM
          to Ho Cheung, Kent Tamura, Wan-Teh Chang, Chromium LUCI CQ, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org
          Attention needed from Ho Cheung and Wan-Teh Chang

          Kent Tamura voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ho Cheung
          • Wan-Teh Chang
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • 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: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
          Gerrit-Change-Number: 7037578
          Gerrit-PatchSet: 5
          Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
          Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
          Gerrit-Attention: Wan-Teh Chang <w...@google.com>
          Gerrit-Attention: Ho Cheung <hoch...@chromium.org>
          Gerrit-Comment-Date: Wed, 15 Oct 2025 04:10:09 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Ho Cheung (Gerrit)

          unread,
          4:05 AM (17 hours ago) 4:05 AM
          to Kent Tamura, Wan-Teh Chang, Chromium LUCI CQ, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org
          Attention needed from Wan-Teh Chang

          Ho Cheung voted and added 1 comment

          Votes added by Ho Cheung

          Commit-Queue+2

          1 comment

          Patchset-level comments
          Ho Cheung . resolved

          Thank you for your review, I will submit this patch and will be happy to code any subsequent changes if needed.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Wan-Teh Chang
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • 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: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
          Gerrit-Change-Number: 7037578
          Gerrit-PatchSet: 5
          Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
          Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
          Gerrit-Attention: Wan-Teh Chang <w...@google.com>
          Gerrit-Comment-Date: Wed, 15 Oct 2025 08:04:48 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Chromium LUCI CQ (Gerrit)

          unread,
          4:20 AM (17 hours ago) 4:20 AM
          to Ho Cheung, Kent Tamura, Wan-Teh Chang, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org

          Chromium LUCI CQ submitted the change

          Change information

          Commit message:
          [image-decoders] Convert BMP image reader to use safe buffer operations

          This CL eliminates all unsafe buffer usage warnings in the BMP image

          reader by migrating to modern C++ safe containers and operations.
          Bug: 451652367
          Change-Id: I172461d3be19531671458ddeec8c26a926a46057
          Commit-Queue: Ho Cheung <hoch...@chromium.org>
          Reviewed-by: Kent Tamura <tk...@chromium.org>
          Cr-Commit-Position: refs/heads/main@{#1530019}
          Files:
          • M third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.cc
          • M third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
          Change size: M
          Delta: 2 files changed, 36 insertions(+), 39 deletions(-)
          Branch: refs/heads/main
          Submit Requirements:
          • requirement satisfiedCode-Review: +1 by Kent Tamura
          Open in Gerrit
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: merged
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
          Gerrit-Change-Number: 7037578
          Gerrit-PatchSet: 6
          Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          open
          diffy
          satisfied_requirement

          Wan-Teh Chang (Gerrit)

          unread,
          11:33 AM (10 hours ago) 11:33 AM
          to Chromium LUCI CQ, Ho Cheung, Kent Tamura, Wan-Teh Chang, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org
          Attention needed from Ho Cheung

          Wan-Teh Chang added 1 comment

          File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
          Line 231, Patchset 3: // of the return value, the caller won't read it.
          Wan-Teh Chang . unresolved

          Delete this comment. It explained why `pixel` wasn't initialized in the original code. The new code initializes `pixel` (to 0).

          Ho Cheung

          Done

          Wan-Teh Chang

          This comment wasn't deleted. Please write a new CL to delete this comment.

          This comment explains why we don't need to initialize `pixel`. Since the new code initializes `pixel` (so the most significate byte of the return value is 0), the comment is out of date and should be deleted.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ho Cheung
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • 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: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
          Gerrit-Change-Number: 7037578
          Gerrit-PatchSet: 6
          Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
          Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
          Gerrit-Attention: Ho Cheung <hoch...@chromium.org>
          Gerrit-Comment-Date: Wed, 15 Oct 2025 15:32:59 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Wan-Teh Chang <w...@google.com>
          Comment-In-Reply-To: Ho Cheung <hoch...@chromium.org>
          satisfied_requirement
          open
          diffy

          Wan-Teh Chang (Gerrit)

          unread,
          11:36 AM (10 hours ago) 11:36 AM
          to Chromium LUCI CQ, Ho Cheung, Kent Tamura, Wan-Teh Chang, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org
          Attention needed from Ho Cheung

          Wan-Teh Chang added 1 comment

          File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
          Line 231, Patchset 3: // of the return value, the caller won't read it.
          Wan-Teh Chang . unresolved

          Delete this comment. It explained why `pixel` wasn't initialized in the original code. The new code initializes `pixel` (to 0).

          Ho Cheung

          Done

          Wan-Teh Chang

          This comment wasn't deleted. Please write a new CL to delete this comment.

          This comment explains why we don't need to initialize `pixel`. Since the new code initializes `pixel` (so the most significate byte of the return value is 0), the comment is out of date and should be deleted.

          Wan-Teh Chang

          I see Kent suggested keeping this comment. Then we need to update this comment. For example,

          ```
          // It doesn't matter that we set the most significant byte
          // of the return value to 0, the caller won't read it.
          ```
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ho Cheung
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • 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: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
          Gerrit-Change-Number: 7037578
          Gerrit-PatchSet: 6
          Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
          Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
          Gerrit-Attention: Ho Cheung <hoch...@chromium.org>
          Gerrit-Comment-Date: Wed, 15 Oct 2025 15:35:58 +0000
          satisfied_requirement
          open
          diffy

          Ho Cheung (Gerrit)

          unread,
          8:59 PM (11 minutes ago) 8:59 PM
          to Chromium LUCI CQ, Kent Tamura, Wan-Teh Chang, AyeAye, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, blink-...@chromium.org
          Attention needed from Wan-Teh Chang

          Ho Cheung added 1 comment

          File third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
          Line 231, Patchset 3: // of the return value, the caller won't read it.
          Wan-Teh Chang . resolved

          Delete this comment. It explained why `pixel` wasn't initialized in the original code. The new code initializes `pixel` (to 0).

          Ho Cheung

          Done

          Wan-Teh Chang

          This comment wasn't deleted. Please write a new CL to delete this comment.

          This comment explains why we don't need to initialize `pixel`. Since the new code initializes `pixel` (so the most significate byte of the return value is 0), the comment is out of date and should be deleted.

          Wan-Teh Chang

          I see Kent suggested keeping this comment. Then we need to update this comment. For example,

          ```
          // It doesn't matter that we set the most significant byte
          // of the return value to 0, the caller won't read it.
          ```
          Ho Cheung

          OK, I've submitted a new patch to address the new issue you raised.

          https://chromium-review.googlesource.com/c/chromium/src/+/7046579

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Wan-Teh Chang
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • 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: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I172461d3be19531671458ddeec8c26a926a46057
          Gerrit-Change-Number: 7037578
          Gerrit-PatchSet: 6
          Gerrit-Owner: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Ho Cheung <hoch...@chromium.org>
          Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
          Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
          Gerrit-Attention: Wan-Teh Chang <w...@google.com>
          Gerrit-Comment-Date: Thu, 16 Oct 2025 00:58:24 +0000
          satisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages