[PR #1393] Fix one-off in dcheck. #2005

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

Original Pull Request: https://github.com/google/brotli/pull/1393

State: closed
Merged: Yes


Fix one-off in dcheck.

How to prove correctness:

  1. when position is 0, max_length is allowed to be ringbuffer_size
  2. in other words: position + max_length <= ringbuffer_size
  3. ringbuffer_mask == ringbuffer_size - 1
  4. thus position + max_length <= ringbuffer_size + 1
**Original Pull Request:** https://github.com/google/brotli/pull/1393 **State:** closed **Merged:** Yes --- Fix one-off in dcheck. How to prove correctness: 1) when `position` is `0`, `max_length` is allowed to be `ringbuffer_size` 2) in other words: `position + max_length <= ringbuffer_size` 3) `ringbuffer_mask == ringbuffer_size - 1` 4) thus `position + max_length <= ringbuffer_size + 1`
claunia added the pull-request label 2026-01-29 20:56:53 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#2005