File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ class XpressDictionary
98
98
INLINE const_bytes Fill (const_bytes data)
99
99
{
100
100
// equivalent to Add(data, ChunkSize)
101
+ if (UNLIKELY (data >= this ->end2 )) { return this ->end2 ; }
101
102
uint32_t pos = WindowPos (data); // either 0x00000 or ChunkSize
102
103
const const_bytes end = ((data + ChunkSize) < this ->end2 ) ? data + ChunkSize : this ->end2 ;
103
104
uint_fast16_t hash = HashUpdate (data[0 ], data[1 ]);
@@ -123,6 +124,7 @@ class XpressDictionary
123
124
124
125
INLINE void Add (const_bytes data, size_t len)
125
126
{
127
+ if (UNLIKELY (data >= this ->end2 )) { return ; }
126
128
uint32_t pos = WindowPos (data);
127
129
const const_bytes end = ((data + len) < this ->end2 ) ? data + len : this ->end2 ;
128
130
uint_fast16_t hash = HashUpdate (data[0 ], data[1 ]);
You can’t perform that action at this time.
0 commit comments