diff options
author | Moonchild <moonchild@palemoon.org> | 2020-11-13 15:59:29 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-11-18 10:58:22 +0000 |
commit | b645d59b1e170af1cb0963935bd8c915e56c431c (patch) | |
tree | 49fdc8001d5758558ada7a711f31e08095388294 /modules/brotli/enc/ringbuffer.h | |
parent | 71e0814af25e8619782294e65aa42aa1044dabdc (diff) | |
download | UXP-b645d59b1e170af1cb0963935bd8c915e56c431c.tar UXP-b645d59b1e170af1cb0963935bd8c915e56c431c.tar.gz UXP-b645d59b1e170af1cb0963935bd8c915e56c431c.tar.lz UXP-b645d59b1e170af1cb0963935bd8c915e56c431c.tar.xz UXP-b645d59b1e170af1cb0963935bd8c915e56c431c.zip |
Issue #1683 - Update Brotli lib to 1.0.9
Diffstat (limited to 'modules/brotli/enc/ringbuffer.h')
-rw-r--r-- | modules/brotli/enc/ringbuffer.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/brotli/enc/ringbuffer.h b/modules/brotli/enc/ringbuffer.h index 86079a89d..8dce14803 100644 --- a/modules/brotli/enc/ringbuffer.h +++ b/modules/brotli/enc/ringbuffer.h @@ -75,7 +75,7 @@ static BROTLI_INLINE void RingBufferInitBuffer( uint8_t* new_data = BROTLI_ALLOC( m, uint8_t, 2 + buflen + kSlackForEightByteHashingEverywhere); size_t i; - if (BROTLI_IS_OOM(m)) return; + if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_data)) return; if (rb->data_) { memcpy(new_data, rb->data_, 2 + rb->cur_size_ + kSlackForEightByteHashingEverywhere); @@ -125,6 +125,9 @@ static BROTLI_INLINE void RingBufferWrite( later when we copy the last two bytes to the first two positions. */ rb->buffer_[rb->size_ - 2] = 0; rb->buffer_[rb->size_ - 1] = 0; + /* Initialize tail; might be touched by "best_len++" optimization when + ring buffer is "full". */ + rb->buffer_[rb->size_] = 241; } { const size_t masked_pos = rb->pos_ & rb->mask_; |