vcl/source/bitmap/alpha.cxx | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 55eabf68ff48762d620b69daefd4116c2023cb0c
Author: Noel Grandin <[email protected]>
AuthorDate: Tue Jan 17 09:00:25 2023 +0200
Commit: Noel Grandin <[email protected]>
CommitDate: Tue Jan 17 08:18:38 2023 +0000
assert/SAL_WARN in BlendWith
instead of just silently doing nothing, so we get some indication of
error
Change-Id: Iac7e21d42b45ebc97cfb95552d98c186b9eb05ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145655
Tested-by: Jenkins
Reviewed-by: Noel Grandin <[email protected]>
diff --git a/vcl/source/bitmap/alpha.cxx b/vcl/source/bitmap/alpha.cxx
index 196ba30d5f57..8618c052ab03 100644
--- a/vcl/source/bitmap/alpha.cxx
+++ b/vcl/source/bitmap/alpha.cxx
@@ -91,8 +91,12 @@ void AlphaMask::BlendWith(const Bitmap& rOther)
AlphaMask aOther(rOther); // to 8 bits
Bitmap::ScopedReadAccess pOtherAcc(aOther);
AlphaScopedWriteAccess pAcc(*this);
+ assert (pOtherAcc && pAcc && pOtherAcc->GetBitCount() == 8 &&
pAcc->GetBitCount() == 8 && "cannot BlendWith this combination");
if (!(pOtherAcc && pAcc && pOtherAcc->GetBitCount() == 8 &&
pAcc->GetBitCount() == 8))
+ {
+ SAL_WARN("vcl", "cannot BlendWith this combination");
return;
+ }
const tools::Long nHeight = std::min(pOtherAcc->Height(), pAcc->Height());
const tools::Long nWidth = std::min(pOtherAcc->Width(), pAcc->Width());