PKG_NAME:=squashfs4
PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs
-PKG_VERSION:=4.7.2
+PKG_VERSION:=4.7.3
PKG_RELEASE=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/plougher/squashfs-tools
-PKG_SOURCE_DATE:=2025-08-19
-PKG_SOURCE_VERSION:=99d23a31b471433c51e9c145aeba2ab1536e34df
-PKG_MIRROR_HASH:=229a1b8f465fa0f576b5ace1753a8e9d28a2c4254ec2b019668baa676094f6c3
+PKG_SOURCE_DATE:=2025-11-06
+PKG_SOURCE_VERSION:=a143ab5534cc9ad4aededf1116fe37bcb1c8674d
+PKG_MIRROR_HASH:=aafdeab814de1081882f858a0997d74e227081bf611fccd84e0d4990f9a51ec4
HOST_BUILD_PARALLEL:=1
--- /dev/null
+From 65222d06c0fa76bdbcbcb83831dd2195c19d990a Mon Sep 17 00:00:00 2001
+Date: Fri, 7 Nov 2025 11:58:37 +0100
+Subject: [PATCH 1/2] mksquashfs: fix build for big-endian architectures
+
+---
+ squashfs-tools/mksquashfs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -7313,7 +7313,7 @@ static int sqfstar(int argc, char *argv[
+
+ memset(&sblk, 0, sizeof(struct squashfs_super_block));
+ sblk.s_magic = SQUASHFS_MAGIC_STREAMED;
+- SQUASHFS_INSWAP_SUPER_BLOCK(sblk);
++ SQUASHFS_INSWAP_SUPER_BLOCK(&sblk);
+ write_destination(fd, SQUASHFS_START,
+ sizeof(struct squashfs_super_block), &sblk);
+ }
+@@ -8600,7 +8600,7 @@ int main(int argc, char *argv[])
+
+ memset(&sblk, 0, sizeof(struct squashfs_super_block));
+ sblk.s_magic = SQUASHFS_MAGIC_STREAMED;
+- SQUASHFS_INSWAP_SUPER_BLOCK(sblk);
++ SQUASHFS_INSWAP_SUPER_BLOCK(&sblk);
+ write_destination(fd, SQUASHFS_START,
+ sizeof(struct squashfs_super_block), &sblk);
+ }
--- /dev/null
+From bc9e11acadd441371e51696f555db031625a9065 Mon Sep 17 00:00:00 2001
+Date: Fri, 7 Nov 2025 11:58:37 +0100
+Subject: [PATCH 2/2] gzip_wrapper: fix byte swapping prototype
+
+---
+ squashfs-tools/gzip_wrapper.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/squashfs-tools/gzip_wrapper.h
++++ b/squashfs-tools/gzip_wrapper.h
+@@ -27,7 +27,7 @@
+ #include "endian_compat.h"
+
+ #if __BYTE_ORDER == __BIG_ENDIAN
+-extern unsigned int inswap_le16(unsigned short);
++extern unsigned short inswap_le16(unsigned short);
+ extern unsigned int inswap_le32(unsigned int);
+
+ #define SQUASHFS_INSWAP_COMP_OPTS(s) { \
--- /dev/null
+From 02e51727923da21bd654ddf0ec8c006f751d86c9 Mon Sep 17 00:00:00 2001
+Date: Fri, 7 Nov 2025 23:13:03 +0000
+Subject: [PATCH] mksquashfs: fix regression introduced by SEEK_DATA
+ optimisation
+
+The representation of a sparse block was changed from 0 to a negative
+number. This was to optimise sparse buffer passing between threads, and
+where a single buffer can now represent a multi-block sparse span.
+
+Unfortunately some code was not correctly updated, and this was not
+picked up in testing.
+
+Fixes: https://github.com/plougher/squashfs-tools/issues/336
+
+---
+ squashfs-tools/mksquashfs.c | 4 ++--
+ squashfs-tools/process_fragments.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -2889,11 +2889,11 @@ static struct file_info *write_file_proc
+ sizeof(unsigned int));
+ block_list[block ++] = read_buffer->c_byte;
+ if(!is_sparse(read_buffer)) {
+- if(sparse_count(read_buffer) > 1)
+- BAD_ERROR("Sparse block too large in write file process\n");
+ file_bytes += read_buffer->size;
+ put_write_buffer_hash(read_buffer);
+ } else {
++ if(sparse_count(read_buffer) > 1)
++ BAD_ERROR("Sparse block too large in write file process\n");
+ sparse += read_buffer->size;
+ gen_cache_block_put(read_buffer);
+ }
+--- a/squashfs-tools/process_fragments.c
++++ b/squashfs-tools/process_fragments.c
+@@ -285,7 +285,7 @@ void *frag_thrd(void *destination_file)
+ int res;
+
+ if(sparse_files && sparse) {
+- file_buffer->c_byte = 0;
++ set_sparse(file_buffer, 1);
+ file_buffer->fragment = FALSE;
+ } else
+ file_buffer->c_byte = file_buffer->size;