File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -861,7 +861,10 @@ uint64_t CompactObj::HashCode() const {
861861 DCHECK (mask_bits_.encoding );
862862
863863 if (IsInline ()) {
864- char buf[kInlineLen * 3 ]; // should suffice for most huffman decodings.
864+ // Buffer must accommodate maximum decompressed size from inline storage
865+ // Highly compressible data can achieve ~8x compression (e.g., repeated character)
866+ // kInlineLen (16 bytes) compressed -> up to 128 bytes decompressed
867+ char buf[kInlineLen * 8 ];
865868 size_t decoded_len = GetStrEncoding ().Decode (string_view{u_.inline_str , taglen_}, buf);
866869 return XXH3_64bits_withSeed (buf, decoded_len, kHashSeed );
867870 }
@@ -1411,7 +1414,8 @@ bool CompactObj::CmpEncoded(string_view sv) const {
14111414 return false ;
14121415
14131416 if (IsInline ()) {
1414- constexpr size_t kMaxHuffLen = kInlineLen * 3 ;
1417+ // Buffer must accommodate maximum decompressed size from inline storage (~8x compression)
1418+ constexpr size_t kMaxHuffLen = kInlineLen * 8 ;
14151419 if (sz <= kMaxHuffLen ) {
14161420 char buf[kMaxHuffLen ];
14171421 const auto & decoder = tl.GetHuffmanDecoder (huffman_domain_);
You can’t perform that action at this time.
0 commit comments