diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-17 09:00:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-17 08:18:38 +0000 |
commit | 55eabf68ff48762d620b69daefd4116c2023cb0c (patch) | |
tree | 89b6ee9b6f8b96aed355f3840d2232087a2972f3 /vcl/source/bitmap | |
parent | d648f2ae3a16d0613d1b75848789b9742eb20b19 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/bitmap')
-rw-r--r-- | vcl/source/bitmap/alpha.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
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()); |