[image] vp8l: vp8l: avoid allocating many unused Huffman tree groups

6 views
Skip to first unread message

Damien Neil (Gerrit)

unread,
Jun 23, 2026, 4:12:30 PMJun 23
to goph...@pubsubhelper.golang.org, Neal Patel, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
Attention needed from Neal Patel

Damien Neil voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Neal Patel
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: image
Gerrit-Branch: master
Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
Gerrit-Change-Number: 793460
Gerrit-PatchSet: 1
Gerrit-Owner: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Neal Patel <neal...@google.com>
Gerrit-Attention: Neal Patel <neal...@google.com>
Gerrit-Comment-Date: Tue, 23 Jun 2026 20:12:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Damien Neil (Gerrit)

unread,
Jul 7, 2026, 5:18:33 PMJul 7
to goph...@pubsubhelper.golang.org, Nigel Tao, Neal Patel, Neal Patel, SLSA Policy Verification Service, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
Attention needed from Neal Patel and Nigel Tao

Damien Neil added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Damien Neil . resolved

(Not sure if you're still reviewing x/image CLs, Nigel, but if you are then you're the actual expert here.)

Open in Gerrit

Related details

Attention is currently required from:
  • Neal Patel
  • Nigel Tao
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement satisfiedSLSA-Policy-Verified
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: image
    Gerrit-Branch: master
    Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
    Gerrit-Change-Number: 793460
    Gerrit-PatchSet: 1
    Gerrit-Owner: Damien Neil <dn...@google.com>
    Gerrit-Reviewer: Damien Neil <dn...@google.com>
    Gerrit-Reviewer: Neal Patel <ne...@golang.org>
    Gerrit-Reviewer: Nigel Tao <nige...@google.com>
    Gerrit-Reviewer: SLSA Policy Verification Service <devtools-gerritco...@google.com>
    Gerrit-CC: Neal Patel <neal...@google.com>
    Gerrit-Attention: Neal Patel <ne...@golang.org>
    Gerrit-Attention: Nigel Tao <nige...@google.com>
    Gerrit-Comment-Date: Tue, 07 Jul 2026 21:18:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Nigel Tao (Gerrit)

    unread,
    Jul 15, 2026, 8:47:40 PM (6 days ago) Jul 15
    to Damien Neil, goph...@pubsubhelper.golang.org, Neal Patel, Neal Patel, SLSA Policy Verification Service, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
    Attention needed from Damien Neil and Neal Patel

    Nigel Tao added 9 comments

    Patchset-level comments
    Nigel Tao . resolved

    Sorry for the slow reply. I was on vacation last week.

    Commit Message
    Line 7, Patchset 1 (Latest):vp8l: vp8l: avoid allocating many unused Huffman tree groups
    Nigel Tao . unresolved

    Duplicate "vp8l:".

    File vp8l/decode.go
    Line 318, Patchset 1 (Latest): var mapping []int
    Nigel Tao . unresolved

    `int` could be `int16`.

    Line 359, Patchset 1 (Latest): if maxHGroupIndex+1 > maxHuffImageSize {
    Nigel Tao . unresolved

    `if maxHGroupIndex >= maxHuffImageSize`

    Ditto (turning `x + 1 > y` into `x >= y`) a few lines below.

    File webp/decode_test.go
    Line 9, Patchset 1 (Latest): "compress/bzip2"
    Nigel Tao . unresolved

    If `testdata/large-huffman-index.lossless.webp.bz2` is only 107 bytes long then it doesn't seem worth adding a `compress/bzip2` dependency here. Just commit the raw file.

    Line 182, Patchset 1 (Latest): "gopher-doc.8bpp",
    Nigel Tao . unresolved

    I wouldd slip "gopher-doc.skip-hgroup.lossless.webp" here instead, perhaps renaming it to "gopher-doc.8bpp.skip-hgroup". See also 💙.

    Line 207, Patchset 1 (Latest): f1, err := os.Open("../testdata/" + tc + ".png")
    Nigel Tao . unresolved

    You might then need a little fix-up here:

    ```
    pngFilename := "../testdata/" + tc + ".png"
    if tc == "gopher-doc.8bpp.skip-hgroup" {
    pngFilename = "../testdata/gopher-doc.8bpp.png"
    }
    f1, err := os.Open(pngFilename)
    ```
    Line 270, Patchset 1 (Latest): switch ext := path.Ext(filename); ext {
    Nigel Tao . unresolved

    Instead of switching on the filename extension, the idiomatic approach is to basically just say `return image.Decode(reader)`, per https://pkg.go.dev/image#Decode

    But then, if you also drop the bz2 thing, I don't think this `decodeFile` function wins you much.

    Line 281, Patchset 1 (Latest): for _, test := range []struct {
    Nigel Tao . unresolved

    Using an anonymous struct type (and `t.Run`) seems overkill if you only have one test case. I'd delete everything from lines 281 to 292 and hard-code name, f0 and f1.

    But also, per 💙, we could probably delete TestDecodeComparisons entirely.

    Ditto (re anonymous struct type) for TestDecodeErrors.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Damien Neil
    • Neal Patel
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement satisfiedSLSA-Policy-Verified
      • requirement satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: image
      Gerrit-Branch: master
      Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
      Gerrit-Change-Number: 793460
      Gerrit-PatchSet: 1
      Gerrit-Owner: Damien Neil <dn...@google.com>
      Gerrit-Reviewer: Damien Neil <dn...@google.com>
      Gerrit-Reviewer: Neal Patel <ne...@golang.org>
      Gerrit-Reviewer: Nigel Tao <nige...@google.com>
      Gerrit-Reviewer: SLSA Policy Verification Service <devtools-gerritco...@google.com>
      Gerrit-CC: Neal Patel <neal...@google.com>
      Gerrit-Attention: Damien Neil <dn...@google.com>
      Gerrit-Attention: Neal Patel <ne...@golang.org>
      Gerrit-Comment-Date: Thu, 16 Jul 2026 00:47:30 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Nigel Tao (Gerrit)

      unread,
      Jul 15, 2026, 9:26:34 PM (6 days ago) Jul 15
      to Damien Neil, goph...@pubsubhelper.golang.org, Neal Patel, Neal Patel, SLSA Policy Verification Service, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
      Attention needed from Damien Neil and Neal Patel

      Nigel Tao added 1 comment

      Patchset-level comments
      Nigel Tao . unresolved

      Sorry for the slow reply. I was on vacation last week.

      Nigel Tao

      dneil / neal, if you prefer (and it might take fewer SWE-hours overall), I'm happy to patch in this CL, make the suggested changes myself, and send out a revised CL for you to review.

      Gerrit-Comment-Date: Thu, 16 Jul 2026 01:26:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Nigel Tao <nige...@google.com>
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Damien Neil (Gerrit)

      unread,
      Jul 17, 2026, 8:06:43 PM (4 days ago) Jul 17
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Damien Neil and Neal Patel

      Damien Neil uploaded new patchset

      Damien Neil uploaded patch set #2 to this change.
      Following approvals got outdated and were removed:
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Damien Neil
      • Neal Patel
      Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedSLSA-Policy-Verified
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: image
        Gerrit-Branch: master
        Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
        Gerrit-Change-Number: 793460
        Gerrit-PatchSet: 2
        unsatisfied_requirement
        open
        diffy

        Damien Neil (Gerrit)

        unread,
        Jul 17, 2026, 8:08:36 PM (4 days ago) Jul 17
        to goph...@pubsubhelper.golang.org, SLSA Policy Verification Service, Nigel Tao, Neal Patel, Neal Patel, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
        Attention needed from Neal Patel and Nigel Tao

        Damien Neil voted and added 9 comments

        Votes added by Damien Neil

        Commit-Queue+1

        9 comments

        Patchset-level comments

        Sorry for the slow reply. I was on vacation last week.

        Nigel Tao

        dneil / neal, if you prefer (and it might take fewer SWE-hours overall), I'm happy to patch in this CL, make the suggested changes myself, and send out a revised CL for you to review.

        Damien Neil

        Sure, if you prefer. I've made some updates, but haven't quite followed your suggestions; PTAL and I'm happy to either handle more comments or an alternate CL.

        Commit Message
        Line 7, Patchset 1:vp8l: vp8l: avoid allocating many unused Huffman tree groups
        Nigel Tao . resolved

        Duplicate "vp8l:".

        Damien Neil

        Done

        File vp8l/decode.go
        Line 318, Patchset 1: var mapping []int
        Nigel Tao . resolved

        `int` could be `int16`.

        Damien Neil

        Done

        Line 359, Patchset 1: if maxHGroupIndex+1 > maxHuffImageSize {
        Nigel Tao . resolved

        `if maxHGroupIndex >= maxHuffImageSize`

        Ditto (turning `x + 1 > y` into `x >= y`) a few lines below.

        Damien Neil

        Done

        File webp/decode_test.go
        Line 9, Patchset 1: "compress/bzip2"
        Nigel Tao . resolved

        If `testdata/large-huffman-index.lossless.webp.bz2` is only 107 bytes long then it doesn't seem worth adding a `compress/bzip2` dependency here. Just commit the raw file.

        Damien Neil

        Uncompressed size is 163879 bytes, which I think is worth it.

        Line 182, Patchset 1: "gopher-doc.8bpp",
        Nigel Tao . resolved

        I wouldd slip "gopher-doc.skip-hgroup.lossless.webp" here instead, perhaps renaming it to "gopher-doc.8bpp.skip-hgroup". See also 💙.

        Damien Neil

        Reworked this test a bit to handle the new test files.

        • webp and png images don't have to have the same base name
        • images can be bz2 compressed (this helps a lot with one case, see below)
        • test cases can include expected decode failures
        Line 207, Patchset 1: f1, err := os.Open("../testdata/" + tc + ".png")
        Nigel Tao . resolved

        You might then need a little fix-up here:

        ```
        pngFilename := "../testdata/" + tc + ".png"
        if tc == "gopher-doc.8bpp.skip-hgroup" {
        pngFilename = "../testdata/gopher-doc.8bpp.png"
        }
        f1, err := os.Open(pngFilename)
        ```
        Damien Neil

        I'd really rather keep this in the table rather than add in special cases here.

        Line 270, Patchset 1: switch ext := path.Ext(filename); ext {
        Nigel Tao . resolved

        Instead of switching on the filename extension, the idiomatic approach is to basically just say `return image.Decode(reader)`, per https://pkg.go.dev/image#Decode

        But then, if you also drop the bz2 thing, I don't think this `decodeFile` function wins you much.

        Damien Neil

        Acknowledged

        Line 281, Patchset 1: for _, test := range []struct {
        Nigel Tao . resolved

        Using an anonymous struct type (and `t.Run`) seems overkill if you only have one test case. I'd delete everything from lines 281 to 292 and hard-code name, f0 and f1.

        But also, per 💙, we could probably delete TestDecodeComparisons entirely.

        Ditto (re anonymous struct type) for TestDecodeErrors.

        Damien Neil

        Overkill for only one case, but this seems like the sort of thing where more cases are inevitable.

        Moved this into TestDecodeVP8L.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Neal Patel
        • Nigel Tao
        Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedSLSA-Policy-Verified
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: image
          Gerrit-Branch: master
          Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
          Gerrit-Change-Number: 793460
          Gerrit-PatchSet: 2
          Gerrit-Owner: Damien Neil <dn...@google.com>
          Gerrit-Reviewer: Damien Neil <dn...@google.com>
          Gerrit-Reviewer: Neal Patel <ne...@golang.org>
          Gerrit-Reviewer: Nigel Tao <nige...@google.com>
          Gerrit-Reviewer: SLSA Policy Verification Service <devtools-gerritco...@google.com>
          Gerrit-CC: Neal Patel <neal...@google.com>
          Gerrit-Attention: Neal Patel <ne...@golang.org>
          Gerrit-Attention: Nigel Tao <nige...@google.com>
          Gerrit-Comment-Date: Sat, 18 Jul 2026 00:08:31 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Nigel Tao <nige...@google.com>
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Nigel Tao (Gerrit)

          unread,
          Jul 20, 2026, 8:37:06 PM (yesterday) Jul 20
          to Damien Neil, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, SLSA Policy Verification Service, Neal Patel, Neal Patel, golang-co...@googlegroups.com
          Attention needed from Damien Neil and Neal Patel

          Nigel Tao voted and added 2 comments

          Votes added by Nigel Tao

          Code-Review+1

          2 comments

          File vp8l/decode.go
          Line 391, Patchset 2 (Latest): for i := 0; i < maxHGroupIndex+1; i++ {
          Nigel Tao . unresolved

          `for i := range maxHGroupIndex+1`

          File webp/decode_test.go
          Line 9, Patchset 1: "compress/bzip2"
          Nigel Tao . resolved

          If `testdata/large-huffman-index.lossless.webp.bz2` is only 107 bytes long then it doesn't seem worth adding a `compress/bzip2` dependency here. Just commit the raw file.

          Damien Neil

          Uncompressed size is 163879 bytes, which I think is worth it.

          Nigel Tao

          Hah, that's a nice 1531x compression ratio from bzip2 there.

          https://screenshot.googleplex.com/image/C6RrVqxEfVV8ATq.png

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Damien Neil
          • Neal Patel
          Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement satisfiedSLSA-Policy-Verified
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: image
            Gerrit-Branch: master
            Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
            Gerrit-Change-Number: 793460
            Gerrit-PatchSet: 2
            Gerrit-Owner: Damien Neil <dn...@google.com>
            Gerrit-Reviewer: Damien Neil <dn...@google.com>
            Gerrit-Reviewer: Neal Patel <ne...@golang.org>
            Gerrit-Reviewer: Nigel Tao <nige...@google.com>
            Gerrit-Reviewer: SLSA Policy Verification Service <devtools-gerritco...@google.com>
            Gerrit-CC: Neal Patel <neal...@google.com>
            Gerrit-Attention: Damien Neil <dn...@google.com>
            Gerrit-Attention: Neal Patel <ne...@golang.org>
            Gerrit-Comment-Date: Tue, 21 Jul 2026 00:36:55 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            Comment-In-Reply-To: Damien Neil <dn...@google.com>
            Comment-In-Reply-To: Nigel Tao <nige...@google.com>
            unsatisfied_requirement
            satisfied_requirement
            open
            diffy

            Nigel Tao (Gerrit)

            unread,
            1:21 AM (22 hours ago) 1:21 AM
            to Damien Neil, goph...@pubsubhelper.golang.org, Nigel Tao, golang...@luci-project-accounts.iam.gserviceaccount.com, SLSA Policy Verification Service, Neal Patel, Neal Patel, golang-co...@googlegroups.com
            Attention needed from Damien Neil and Neal Patel

            Nigel Tao voted Code-Review+2

            Code-Review+2
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Damien Neil
            • Neal Patel
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement satisfiedSLSA-Policy-Verified
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: image
            Gerrit-Branch: master
            Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
            Gerrit-Change-Number: 793460
            Gerrit-PatchSet: 2
            Gerrit-Owner: Damien Neil <dn...@google.com>
            Gerrit-Reviewer: Damien Neil <dn...@google.com>
            Gerrit-Reviewer: Neal Patel <ne...@golang.org>
            Gerrit-Reviewer: Nigel Tao <nige...@golang.org>
            Gerrit-Reviewer: Nigel Tao <nige...@google.com>
            Gerrit-Reviewer: SLSA Policy Verification Service <devtools-gerritco...@google.com>
            Gerrit-CC: Neal Patel <neal...@google.com>
            Gerrit-Attention: Damien Neil <dn...@google.com>
            Gerrit-Attention: Neal Patel <ne...@golang.org>
            Gerrit-Comment-Date: Tue, 21 Jul 2026 05:21:47 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Neal Patel (Gerrit)

            unread,
            11:26 AM (12 hours ago) 11:26 AM
            to Damien Neil, goph...@pubsubhelper.golang.org, Nigel Tao, Nigel Tao, golang...@luci-project-accounts.iam.gserviceaccount.com, SLSA Policy Verification Service, Neal Patel, golang-co...@googlegroups.com
            Attention needed from Damien Neil and Neal Patel

            Neal Patel voted Code-Review+1

            Code-Review+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Damien Neil
            • Neal Patel
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement satisfiedSLSA-Policy-Verified
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: image
            Gerrit-Branch: master
            Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
            Gerrit-Change-Number: 793460
            Gerrit-PatchSet: 2
            Gerrit-Owner: Damien Neil <dn...@google.com>
            Gerrit-Reviewer: Damien Neil <dn...@google.com>
            Gerrit-Reviewer: Neal Patel <ne...@golang.org>
            Gerrit-Reviewer: Neal Patel <neal...@google.com>
            Gerrit-Reviewer: Nigel Tao <nige...@golang.org>
            Gerrit-Reviewer: Nigel Tao <nige...@google.com>
            Gerrit-Reviewer: SLSA Policy Verification Service <devtools-gerritco...@google.com>
            Gerrit-Attention: Damien Neil <dn...@google.com>
            Gerrit-Attention: Neal Patel <ne...@golang.org>
            Gerrit-Comment-Date: Tue, 21 Jul 2026 15:26:09 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Damien Neil (Gerrit)

            unread,
            8:00 PM (4 hours ago) 8:00 PM
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Damien Neil

            Damien Neil uploaded new patchset

            Damien Neil uploaded patch set #3 to this change.
            Following approvals got outdated and were removed:

            Related details

            Attention is currently required from:
            • Damien Neil
            Submit Requirements:
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement satisfiedReview-Enforcement
              • requirement satisfiedSLSA-Policy-Verified
              • requirement is not satisfiedTryBots-Pass
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: newpatchset
              Gerrit-Project: image
              Gerrit-Branch: master
              Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
              Gerrit-Change-Number: 793460
              Gerrit-PatchSet: 3
              Gerrit-Owner: Damien Neil <dn...@google.com>
              Gerrit-Reviewer: Damien Neil <dn...@google.com>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Damien Neil (Gerrit)

              unread,
              8:01 PM (4 hours ago) 8:01 PM
              to goph...@pubsubhelper.golang.org, SLSA Policy Verification Service, Neal Patel, Nigel Tao, Nigel Tao, golang...@luci-project-accounts.iam.gserviceaccount.com, golang-co...@googlegroups.com
              Attention needed from Nigel Tao

              Damien Neil voted and added 1 comment

              Votes added by Damien Neil

              Auto-Submit+1
              Commit-Queue+1

              1 comment

              File vp8l/decode.go
              Line 391, Patchset 2: for i := 0; i < maxHGroupIndex+1; i++ {
              Nigel Tao . resolved

              `for i := range maxHGroupIndex+1`

              Damien Neil

              I keep forgetting x/ repos can use range-over-int now. Done.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Nigel Tao
              Submit Requirements:
              • requirement satisfiedCode-Review
              • requirement satisfiedNo-Unresolved-Comments
              • requirement satisfiedReview-Enforcement
              • requirement satisfiedSLSA-Policy-Verified
              • requirement is not satisfiedTryBots-Pass
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: image
              Gerrit-Branch: master
              Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
              Gerrit-Change-Number: 793460
              Gerrit-PatchSet: 3
              Gerrit-Owner: Damien Neil <dn...@google.com>
              Gerrit-Reviewer: Damien Neil <dn...@google.com>
              Gerrit-Reviewer: Neal Patel <neal...@google.com>
              Gerrit-Reviewer: Nigel Tao <nige...@golang.org>
              Gerrit-Reviewer: Nigel Tao <nige...@google.com>
              Gerrit-Reviewer: SLSA Policy Verification Service <devtools-gerritco...@google.com>
              Gerrit-Attention: Nigel Tao <nige...@google.com>
              Gerrit-Comment-Date: Wed, 22 Jul 2026 00:00:55 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              Comment-In-Reply-To: Nigel Tao <nige...@google.com>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Gopher Robot (Gerrit)

              unread,
              8:07 PM (4 hours ago) 8:07 PM
              to Damien Neil, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, golang...@luci-project-accounts.iam.gserviceaccount.com, SLSA Policy Verification Service, Neal Patel, Nigel Tao, Nigel Tao, golang-co...@googlegroups.com

              Gopher Robot submitted the change with unreviewed changes

              Unreviewed changes

              2 is the latest approved patch-set.
              The change was submitted with unreviewed changes in the following files:

              ```
              The name of the file: vp8l/decode.go
              Insertions: 1, Deletions: 1.

              @@ -388,7 +388,7 @@
              }

              hGroups = make([]hGroup, numHGroups)
              - for i := 0; i < maxHGroupIndex+1; i++ {
              + for i := range maxHGroupIndex + 1 {
              var hg *hGroup
              if mapping == nil {
              hg = &hGroups[i]
              ```

              Change information

              Commit message:
              vp8l: avoid allocating many unused Huffman tree groups

              A VP8L image contains a number of Huffman tree groups.
              The number of groups is derived from the largest group index
              observed in the file. The largest possible index is 2^16-1.

              A VP8L file may included unused groups.

              Decoding and storing all unused groups can cause excessive
              memory allocation from a small input file.

              Use the same approach to unused groups as libwebp:
              When there are many groups (for some definition of "many"),
              store the groups as a compacted array with unreferenced
              groups removed, and rewrite all references to index into
              the new array.

              In addition, limit the total number of groups to 2600.
              The libwebp encoder never produces more than this number of
              groups, and there don't seem to be any other encoders in
              common use.

              Fixes golang/go#80069
              Fixes CVE-2026-46603
              Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
              Auto-Submit: Damien Neil <dn...@google.com>
              SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritco...@google.com>
              Reviewed-by: Nigel Tao <nige...@golang.org>
              Reviewed-by: Neal Patel <neal...@google.com>
              Reviewed-by: Nigel Tao <nige...@google.com>
              Files:
              • A testdata/gopher-doc.skip-hgroup.lossless.webp
              • A testdata/large-huffman-index.lossless.webp.bz2
              • M vp8l/decode.go
              • M webp/decode_test.go
              Change size: L
              Delta: 4 files changed, 194 insertions(+), 77 deletions(-)
              Branch: refs/heads/master
              Submit Requirements:
              Open in Gerrit
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: merged
              Gerrit-Project: image
              Gerrit-Branch: master
              Gerrit-Change-Id: I8738d53b67510a8c12b99fd4df55f4126a6a6964
              Gerrit-Change-Number: 793460
              Gerrit-PatchSet: 4
              Gerrit-Owner: Damien Neil <dn...@google.com>
              Gerrit-Reviewer: Damien Neil <dn...@google.com>
              Gerrit-Reviewer: Gopher Robot <go...@golang.org>
              open
              diffy
              satisfied_requirement
              Reply all
              Reply to author
              Forward
              0 new messages