vcl/source/bitmap/bitmap.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3b544a311d6ab22e1e04c45a841d5f24d5c6b325
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Thu Jan 21 12:56:48 2021 +0100
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Thu Mar 18 14:42:37 2021 +0100

    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.lu...@collabora.com>

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) );
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to