Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package openrct2 for openSUSE:Factory 
checked in at 2023-08-14 22:36:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openrct2 (Old)
 and      /work/SRC/openSUSE:Factory/.openrct2.new.11712 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "openrct2"

Mon Aug 14 22:36:20 2023 rev:15 rq:1103912 version:0.4.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/openrct2/openrct2.changes        2023-04-05 
21:36:09.922743224 +0200
+++ /work/SRC/openSUSE:Factory/.openrct2.new.11712/openrct2.changes     
2023-08-14 22:36:43.816786401 +0200
@@ -1,0 +2,6 @@
+Thu Aug 10 10:16:29 UTC 2023 - Dominique Leuenberger <dims...@opensuse.org>
+
+- Add 19283.patch: Fix build with new zip where zip_replace is
+  deprecated.
+
+-------------------------------------------------------------------

New:
----
  19283.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ openrct2.spec ++++++
--- /var/tmp/diff_new_pack.d1c27h/_old  2023-08-14 22:36:44.572791208 +0200
+++ /var/tmp/diff_new_pack.d1c27h/_new  2023-08-14 22:36:44.576791234 +0200
@@ -35,6 +35,8 @@
 Source2:        
https://github.com/OpenRCT2/objects/archive/v%{objects_version}.tar.gz#/objects-%{objects_version}.tar.gz
 #PATCH-FIX-UPSTREAM Included in next release: 
https://github.com/OpenRCT2/OpenRCT2/pull/19519
 Patch1:         0001-GCC-13-fixes-19519.patch
+# PATCH-FIX-UPSTREAM 19283.patch - fix memleak and Replace deprecated 
functions in zip
+Patch2:         
https://patch-diff.githubusercontent.com/raw/OpenRCT2/OpenRCT2/pull/19283.patch
 BuildRequires:  cmake >= 3.9
 BuildRequires:  fdupes
 BuildRequires:  gcc-c++

++++++ 19283.patch ++++++
>From e3447c363b91b49dc5b0b673a2e2e36ac78266e0 Mon Sep 17 00:00:00 2001
From: icy17 <1061499...@qq.com>
Date: Fri, 27 Jan 2023 11:59:09 +0800
Subject: [PATCH 1/2] fix memleak

---
 src/openrct2/core/Zip.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/openrct2/core/Zip.cpp b/src/openrct2/core/Zip.cpp
index 04d8a7410656..510e9e4ffd89 100644
--- a/src/openrct2/core/Zip.cpp
+++ b/src/openrct2/core/Zip.cpp
@@ -169,13 +169,18 @@ class ZipArchive final : public IZipArchive
 
         auto source = zip_source_buffer(_zip, writeBuffer.data(), 
writeBuffer.size(), 0);
         auto index = GetIndexFromPath(path);
+        zip_int64_t res = 0;
         if (index.has_value())
         {
-            zip_replace(_zip, index.value(), source);
+            res = zip_replace(_zip, index.value(), source);
         }
         else
         {
-            zip_add(_zip, path.data(), source);
+            res = zip_add(_zip, path.data(), source);
+        }
+        if (res == -1)
+        {
+            zip_source_free(source);
         }
     }
 

>From 636b5e55a23711b0a5772823921aa303b5cf07f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+zehm...@users.noreply.github.com>
Date: Thu, 9 Mar 2023 02:31:28 +0200
Subject: [PATCH 2/2] Replace deprecated functions and throw on error

---
 src/openrct2/core/Zip.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/openrct2/core/Zip.cpp b/src/openrct2/core/Zip.cpp
index 510e9e4ffd89..9ecae3aa20d8 100644
--- a/src/openrct2/core/Zip.cpp
+++ b/src/openrct2/core/Zip.cpp
@@ -172,15 +172,16 @@ class ZipArchive final : public IZipArchive
         zip_int64_t res = 0;
         if (index.has_value())
         {
-            res = zip_replace(_zip, index.value(), source);
+            res = zip_file_replace(_zip, index.value(), source, 0);
         }
         else
         {
-            res = zip_add(_zip, path.data(), source);
+            res = zip_file_add(_zip, path.data(), source, 0);
         }
         if (res == -1)
         {
             zip_source_free(source);
+            throw std::runtime_error("Unable to set file contents.");
         }
     }
 

Reply via email to