From f0dcccf11c294de25b24cbf8e44f0941ccd3689b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Tue, 27 May 2025 16:23:48 +0300 Subject: [PATCH] Fix `unzSeekCurrentFile` not resetting `total_out_64`. --- thirdparty/minizip/patches/0001-godot-seek.patch | 4 +++- thirdparty/minizip/unzip.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/thirdparty/minizip/patches/0001-godot-seek.patch b/thirdparty/minizip/patches/0001-godot-seek.patch index ed6161eef27..c03fb14041c 100644 --- a/thirdparty/minizip/patches/0001-godot-seek.patch +++ b/thirdparty/minizip/patches/0001-godot-seek.patch @@ -127,7 +127,7 @@ index ea05b7d62a..7e8a6ac2d3 100644 s->pfile_in_zip_read = pfile_in_zip_read_info; s->encrypted = 0; -@@ -1510,6 +1530,82 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, +@@ -1510,6 +1530,84 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, return UNZ_OK; } @@ -159,6 +159,7 @@ index ea05b7d62a..7e8a6ac2d3 100644 + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + pfile_in_zip_read_info->stream.total_out = pos; ++ pfile_in_zip_read_info->total_out_64 = pos; + + return ZSEEK64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, @@ -182,6 +183,7 @@ index ea05b7d62a..7e8a6ac2d3 100644 + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + pfile_in_zip_read_info->stream.total_out = 0; ++ pfile_in_zip_read_info->total_out_64 = 0; + pfile_in_zip_read_info->stream.next_in = 0; + } + diff --git a/thirdparty/minizip/unzip.c b/thirdparty/minizip/unzip.c index 7e8a6ac2d38..5742b7832cf 100644 --- a/thirdparty/minizip/unzip.c +++ b/thirdparty/minizip/unzip.c @@ -1558,6 +1558,7 @@ extern int ZEXPORT unzSeekCurrentFile(unzFile file, int pos) { pfile_in_zip_read_info->stream.avail_in = (uInt)0; pfile_in_zip_read_info->stream.total_out = pos; + pfile_in_zip_read_info->total_out_64 = pos; return ZSEEK64(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream, @@ -1581,6 +1582,7 @@ extern int ZEXPORT unzSeekCurrentFile(unzFile file, int pos) { pfile_in_zip_read_info->stream.avail_in = (uInt)0; pfile_in_zip_read_info->stream.total_out = 0; + pfile_in_zip_read_info->total_out_64 = 0; pfile_in_zip_read_info->stream.next_in = 0; }