From fbd42f2bda22990ee1eb9019e66f1dd21e952cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 5 May 2021 09:06:08 +0100 Subject: [PATCH] Resolves: rhbz#1957034 fix assertion on avmedia volumne control --- ...88-fix-assertion-on-avmedia-MediaCon.patch | 42 +++++++++++++++++++ libreoffice.spec | 2 + 2 files changed, 44 insertions(+) create mode 100644 0001-Related-tdf-138888-fix-assertion-on-avmedia-MediaCon.patch diff --git a/0001-Related-tdf-138888-fix-assertion-on-avmedia-MediaCon.patch b/0001-Related-tdf-138888-fix-assertion-on-avmedia-MediaCon.patch new file mode 100644 index 0000000..372e523 --- /dev/null +++ b/0001-Related-tdf-138888-fix-assertion-on-avmedia-MediaCon.patch @@ -0,0 +1,42 @@ +From f4e496af66bc6a779f600158cc42b986d654f143 Mon Sep 17 00:00:00 2001 +From: Julien Nabet +Date: Mon, 14 Dec 2020 19:45:22 +0100 +Subject: [PATCH] Related tdf#138888: fix assertion on avmedia/MediaControlBase + +Assertion when trying to insert a video in Impress, see bt: +https://bugs.documentfoundation.org/attachment.cgi?id=168161 + +According to https://en.cppreference.com/w/cpp/algorithm/clamp +"behavior is undefined if the value of lo is greater than hi" + +Regression from: +commit 36b3b357fe2a882db6a5f5a006239e16200fb847 +Author: Noel +Date: Thu Nov 12 16:10:56 2020 +0200 + + replace std::min(std::max()) with std::clamp + +Change-Id: Idf33eb6c662b60174678f990f98aefc72edec2a6 +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107722 +Tested-by: Jenkins +Reviewed-by: Noel Grandin +--- + avmedia/source/framework/MediaControlBase.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx +index ef92cce8a736..890bb04d805b 100644 +--- a/avmedia/source/framework/MediaControlBase.cxx ++++ b/avmedia/source/framework/MediaControlBase.cxx +@@ -64,7 +64,7 @@ void MediaControlBase::UpdateVolumeSlider( MediaItem const & aMediaItem ) + { + mxVolumeSlider->set_sensitive(true); + const sal_Int32 nVolumeDB = aMediaItem.getVolumeDB(); +- mxVolumeSlider->set_value( std::clamp( nVolumeDB, sal_Int32(0), AVMEDIA_DB_RANGE ) ); ++ mxVolumeSlider->set_value( std::clamp( nVolumeDB, AVMEDIA_DB_RANGE, sal_Int32(0)) ); + } + } + +-- +2.31.1 + diff --git a/libreoffice.spec b/libreoffice.spec index d1fba4e..519ecab 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -253,6 +253,7 @@ Patch5: 0001-Related-tdf-141197-critical-a11y-warning.patch Patch6: 0001-tdf-141197-if-we-have-a-sysobj-child-then-include-th.patch Patch7: 0001-Get-rid-of-apache-commons-logging.patch Patch8: 0001-rhbz-1956977-crash-on-switch-from-active-comment-to-.patch +Patch9: 0001-Related-tdf-138888-fix-assertion-on-avmedia-MediaCon.patch # not upstreamed Patch500: 0001-disable-libe-book-support.patch @@ -2240,6 +2241,7 @@ gtk-update-icon-cache -q %{_datadir}/icons/hicolor &>/dev/null || : %changelog * Wed May 05 2021 Caolán McNamara - 1:7.1.2.2-4 - Resolves: rhbz#1956977 Impress crashes on switch from commenting to slide sorter +- Resolves: rhbz#1957034 fix assertion on avmedia volumne control * Thu Apr 29 2021 Caolán McNamara - 1:7.1.2.2-3 - Resolves: rhbz#1955013 build libreoffice-langpack-fy for libreoffice