summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2020-12-14 19:45:22 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-12-15 08:29:32 +0100
commitf4e496af66bc6a779f600158cc42b986d654f143 (patch)
tree34634837357f54400b8ae5d98d99c615f1554aa0 /avmedia
parent863ceb32ca152dff2a8feb716e2929be196a8295 (diff)
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 <noelgrandin@gmail.com> 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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/framework/MediaControlBase.cxx2
1 files changed, 1 insertions, 1 deletions
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)) );
}
}