From e32a090617ff276757b4fb35c73041d8cdf6896ed16e1ad2c9b207f70eec2ea2 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Thu, 14 Feb 2019 16:49:25 +0000 Subject: [PATCH] Accepting request 676185 from home:lachs0r:branches:multimedia:apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add aegisub-DataBlockCache-Fix-crash-in-cache-invalidation.patch Fixes undefined behavior e.g. when scrolling the audio view in spectrogram mode. This patch has been contributed here rather than the official upstream: https://github.com/TypesettingTools/Aegisub/pull/34 The reason for this is that the single upstream maintainer has neither time nor inclination to review pull requests but also isn’t willing to hand out push access to other contributors. This will likely only happen once these contributors have managed to prepare a new release of Aegisub that works on all platforms. Hence, most development now happens at the TypesettingTools repository. OBS-URL: https://build.opensuse.org/request/show/676185 OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/aegisub?expand=0&rev=55 --- ...ache-Fix-crash-in-cache-invalidation.patch | 28 +++++++++++++++++++ aegisub.changes | 7 +++++ aegisub.spec | 7 +++-- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 aegisub-DataBlockCache-Fix-crash-in-cache-invalidation.patch diff --git a/aegisub-DataBlockCache-Fix-crash-in-cache-invalidation.patch b/aegisub-DataBlockCache-Fix-crash-in-cache-invalidation.patch new file mode 100644 index 0000000..ce670ea --- /dev/null +++ b/aegisub-DataBlockCache-Fix-crash-in-cache-invalidation.patch @@ -0,0 +1,28 @@ +From 7479ffbd6d9cc9bf9786d1f1d9f0e6307198681f Mon Sep 17 00:00:00 2001 +From: Martin Herkt +Date: Thu, 14 Feb 2019 14:52:27 +0100 +Subject: [PATCH] DataBlockCache: Fix crash in cache invalidation + +Fixes #33 +--- + src/block_cache.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/block_cache.h b/src/block_cache.h +index 9fcaf42e7..f2ebfa261 100644 +--- a/src/block_cache.h ++++ b/src/block_cache.h +@@ -150,8 +150,8 @@ public: + } + + // Remove old entries until we're under the max size +- for (auto it = age.rbegin(); size > max_size && it != age.rend(); ) +- KillMacroBlock(**it++); ++ for (auto it = age.rbegin(); size > max_size && it != age.rend(); it++) ++ KillMacroBlock(**it); + } + + /// @brief Obtain a data block from the cache +-- +2.20.1 + diff --git a/aegisub.changes b/aegisub.changes index 7cddc3a..9a041ae 100644 --- a/aegisub.changes +++ b/aegisub.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Feb 14 16:09:23 UTC 2019 - Martin Herkt <9+suse@cirno.systems> + +- Add aegisub-DataBlockCache-Fix-crash-in-cache-invalidation.patch + Fixes undefined behavior e.g. when scrolling the audio view in + spectrogram mode. + ------------------------------------------------------------------- Fri Aug 31 11:55:30 UTC 2018 - Jan Engelhardt diff --git a/aegisub.spec b/aegisub.spec index 1c44e22..82f43d9 100644 --- a/aegisub.spec +++ b/aegisub.spec @@ -1,7 +1,7 @@ # # spec file for package aegisub # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -34,6 +34,8 @@ Patch4: aegisub-no-optimize.patch Patch5: luabins.patch #PATCH-FIX-OPENSUSE - davejplater@gmail.com - aegisub-git-version.patch - Create git_version.h which is missing in git. Patch7: aegisub-git-version.patch +#PATCH-FIX-UPSTREAM - 9@cirno.systems - aegisub-DataBlockCache-Fix-crash-in-cache-invalidation.patch - Fixes undefined behavior e.g. when scrolling the audio view in spectrogram mode. +Patch8: aegisub-DataBlockCache-Fix-crash-in-cache-invalidation.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ @@ -71,6 +73,7 @@ effects in the subtitles, apart from just basic timed text. %patch4 -p1 %patch5 -p1 %patch7 +%patch8 -p1 FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y') sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" src/version.cpp FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M:%%S')