diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-01-21 12:56:48 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-03-18 14:42:37 +0100 |
commit | 3b544a311d6ab22e1e04c45a841d5f24d5c6b325 (patch) | |
tree | ffc83cc892b5eaf3a05541aa1effca0c3469e802 /vcl | |
parent | 166412cb09eef1a65219f7ba27a219440a5a89ea (diff) |
fix incorrect palette color indexes
nSrcCount is obviously not supposed to be related to pDstAcc if
it's used to index pSrcAcc. And nNextIndex is used to index pDstAcc,
so it should be compared to nDstCount.
Change-Id: Icc47f316a8c376943c66d1ef6127a6f85c56b624
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112667
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/bitmap/bitmap.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index caf589149382..ab83d18bd004 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -579,10 +579,10 @@ bool Bitmap::CopyPixel( const tools::Rectangle& rRectDst, if( pSrcAcc && pDstAcc ) { - const int nSrcCount = pDstAcc->GetPaletteEntryCount(); + const int nSrcCount = pSrcAcc->GetPaletteEntryCount(); const int nDstCount = 1 << nDstBitCount; - for (int i = 0; ( i < nSrcCount ) && ( nNextIndex < nSrcCount ); ++i) + for (int i = 0; ( i < nSrcCount ) && ( nNextIndex < nDstCount ); ++i) { const BitmapColor& rSrcCol = pSrcAcc->GetPaletteColor( static_cast<sal_uInt16>(i) ); |