summaryrefslogtreecommitdiff
path: root/lib/sqfs/comp/lz4.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-24 16:36:20 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-24 16:47:49 +0100
commit162142b7930248d83a77e8d8f4eba5896d5b267a (patch)
treef65796333f80b4f710a19f5fcb6770d6aedbafe6 /lib/sqfs/comp/lz4.c
parentdea3b64dd11a3a3391bd9d8f8c26f20392e7eb3c (diff)
Cleanup libsquashfs invalid argument error codes
- Add an explicit "you're holding it wrong" error code. - Consistently return error codes and not have some special places where -1 is returned. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/comp/lz4.c')
-rw-r--r--lib/sqfs/comp/lz4.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqfs/comp/lz4.c b/lib/sqfs/comp/lz4.c
index dcee7d8..dd9b6ac 100644
--- a/lib/sqfs/comp/lz4.c
+++ b/lib/sqfs/comp/lz4.c
@@ -66,7 +66,7 @@ static sqfs_s32 lz4_comp_block(sqfs_compressor_t *base, const sqfs_u8 *in,
int ret;
if (size >= 0x7FFFFFFF)
- return 0;
+ return SQFS_ERROR_ARG_INVALID;
if (lz4->high_compression) {
ret = LZ4_compress_HC((void *)in, (void *)out,
@@ -89,7 +89,7 @@ static sqfs_s32 lz4_uncomp_block(sqfs_compressor_t *base, const sqfs_u8 *in,
(void)base;
if (outsize >= 0x7FFFFFFF)
- return 0;
+ return SQFS_ERROR_ARG_INVALID;
ret = LZ4_decompress_safe((void *)in, (void *)out, size, outsize);