|
@@ -72,7 +72,7 @@ STATIC inline int INIT unlz4(u8 *input, long in_len,
|
|
error("NULL input pointer and missing fill function");
|
|
error("NULL input pointer and missing fill function");
|
|
goto exit_1;
|
|
goto exit_1;
|
|
} else {
|
|
} else {
|
|
- inp = large_malloc(lz4_compressbound(uncomp_chunksize));
|
|
|
|
|
|
+ inp = large_malloc(LZ4_compressBound(uncomp_chunksize));
|
|
if (!inp) {
|
|
if (!inp) {
|
|
error("Could not allocate input buffer");
|
|
error("Could not allocate input buffer");
|
|
goto exit_1;
|
|
goto exit_1;
|
|
@@ -136,7 +136,7 @@ STATIC inline int INIT unlz4(u8 *input, long in_len,
|
|
inp += 4;
|
|
inp += 4;
|
|
size -= 4;
|
|
size -= 4;
|
|
} else {
|
|
} else {
|
|
- if (chunksize > lz4_compressbound(uncomp_chunksize)) {
|
|
|
|
|
|
+ if (chunksize > LZ4_compressBound(uncomp_chunksize)) {
|
|
error("chunk length is longer than allocated");
|
|
error("chunk length is longer than allocated");
|
|
goto exit_2;
|
|
goto exit_2;
|
|
}
|
|
}
|
|
@@ -152,11 +152,14 @@ STATIC inline int INIT unlz4(u8 *input, long in_len,
|
|
out_len -= dest_len;
|
|
out_len -= dest_len;
|
|
} else
|
|
} else
|
|
dest_len = out_len;
|
|
dest_len = out_len;
|
|
- ret = lz4_decompress(inp, &chunksize, outp, dest_len);
|
|
|
|
|
|
+
|
|
|
|
+ ret = LZ4_decompress_fast(inp, outp, dest_len);
|
|
|
|
+ chunksize = ret;
|
|
#else
|
|
#else
|
|
dest_len = uncomp_chunksize;
|
|
dest_len = uncomp_chunksize;
|
|
- ret = lz4_decompress_unknownoutputsize(inp, chunksize, outp,
|
|
|
|
- &dest_len);
|
|
|
|
|
|
+
|
|
|
|
+ ret = LZ4_decompress_safe(inp, outp, chunksize, dest_len);
|
|
|
|
+ dest_len = ret;
|
|
#endif
|
|
#endif
|
|
if (ret < 0) {
|
|
if (ret < 0) {
|
|
error("Decoding failed");
|
|
error("Decoding failed");
|