[PR #115] [MERGED] Bug fixes for the brotli encoder. #723

Open
opened 2026-01-29 20:50:33 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/google/brotli/pull/115
Author: @szabadka
Created: 6/12/2015
Status: Merged
Merged: 6/12/2015
Merged by: @szabadka

Base: masterHead: master


📝 Commits (1)

  • 65f3fc5 Bug fixes for the brotli encoder.

📊 Changes

8 files changed (+26 additions, -24 deletions)

View changed files

📝 enc/bit_cost.h (+3 -0)
📝 enc/block_splitter.cc (+2 -2)
📝 enc/encode.cc (+10 -11)
📝 enc/encode.h (+1 -0)
📝 enc/encode_parallel.cc (+7 -3)
📝 enc/entropy_encode.h (+1 -1)
📝 enc/histogram.h (+0 -7)
📝 enc/port.h (+2 -0)

📄 Description

  • Fix an out-of-bounds access to depth_histo in the
    bit cost calculation function.
  • Change type of distance symbol to uint16_t in block
    splitter, because if all postfix bits are used, there
    can be 520 distance symbols.
  • Save the distance cache between meta-blocks at the
    correct place. This fixes a roundtrip failure that
    can occur when there is an uncompressed metablock
    between two compressed metablocks.
  • Fix a bug when setting lgwin to 24 in the encoder parameters
    It ended up making metablocks larger than 24 bits in size.
  • Fix out-of-bounds memory accesses in parallel encoder.
    CreateBackwardReferences can read up to 4 bytes past end of
    input if the end of input is before mask.
  • Add missing header for memcpy() in port.h

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/google/brotli/pull/115 **Author:** [@szabadka](https://github.com/szabadka) **Created:** 6/12/2015 **Status:** ✅ Merged **Merged:** 6/12/2015 **Merged by:** [@szabadka](https://github.com/szabadka) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`65f3fc5`](https://github.com/google/brotli/commit/65f3fc55f562452e64156525d5dc0fcd9fbaf898) Bug fixes for the brotli encoder. ### 📊 Changes **8 files changed** (+26 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `enc/bit_cost.h` (+3 -0) 📝 `enc/block_splitter.cc` (+2 -2) 📝 `enc/encode.cc` (+10 -11) 📝 `enc/encode.h` (+1 -0) 📝 `enc/encode_parallel.cc` (+7 -3) 📝 `enc/entropy_encode.h` (+1 -1) 📝 `enc/histogram.h` (+0 -7) 📝 `enc/port.h` (+2 -0) </details> ### 📄 Description - Fix an out-of-bounds access to depth_histo in the bit cost calculation function. - Change type of distance symbol to uint16_t in block splitter, because if all postfix bits are used, there can be 520 distance symbols. - Save the distance cache between meta-blocks at the correct place. This fixes a roundtrip failure that can occur when there is an uncompressed metablock between two compressed metablocks. - Fix a bug when setting lgwin to 24 in the encoder parameters It ended up making metablocks larger than 24 bits in size. - Fix out-of-bounds memory accesses in parallel encoder. CreateBackwardReferences can read up to 4 bytes past end of input if the end of input is before mask. - Add missing header for memcpy() in port.h --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 20:50:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#723