chores: update LZ4 (#5102)
This commit is contained in:
+13
-2
@@ -1931,6 +1931,17 @@ read_variable_length(const BYTE** ip, const BYTE* ilimit,
|
|||||||
if (initial_check && unlikely((*ip) >= ilimit)) { /* read limit reached */
|
if (initial_check && unlikely((*ip) >= ilimit)) { /* read limit reached */
|
||||||
return rvl_error;
|
return rvl_error;
|
||||||
}
|
}
|
||||||
|
s = **ip;
|
||||||
|
(*ip)++;
|
||||||
|
length += s;
|
||||||
|
if (unlikely((*ip) > ilimit)) { /* read limit reached */
|
||||||
|
return rvl_error;
|
||||||
|
}
|
||||||
|
/* accumulator overflow detection (32-bit mode only) */
|
||||||
|
if ((sizeof(length) < 8) && unlikely(length > ((Rvl_t)(-1)/2)) ) {
|
||||||
|
return rvl_error;
|
||||||
|
}
|
||||||
|
if (likely(s != 255)) return length;
|
||||||
do {
|
do {
|
||||||
s = **ip;
|
s = **ip;
|
||||||
(*ip)++;
|
(*ip)++;
|
||||||
@@ -1939,10 +1950,10 @@ read_variable_length(const BYTE** ip, const BYTE* ilimit,
|
|||||||
return rvl_error;
|
return rvl_error;
|
||||||
}
|
}
|
||||||
/* accumulator overflow detection (32-bit mode only) */
|
/* accumulator overflow detection (32-bit mode only) */
|
||||||
if ((sizeof(length)<8) && unlikely(length > ((Rvl_t)(-1)/2)) ) {
|
if ((sizeof(length) < 8) && unlikely(length > ((Rvl_t)(-1)/2)) ) {
|
||||||
return rvl_error;
|
return rvl_error;
|
||||||
}
|
}
|
||||||
} while (s==255);
|
} while (s == 255);
|
||||||
|
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user