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

New commits:
commit 1af0bf010b839b7b34e856dfc5a7385db45c9aa7
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sun Apr 17 20:03:26 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Apr 18 13:03:43 2022 +0200

    tdf#142151: Red cast rendered in 16 bit TIFF image
    
    I found this fix by testing "pure" red/green/blue files (see attachments in 
the bugtracker)
    where red 16 bits file was ok but not green and blue 16 bits ones.
    
    Change-Id: Ic700a0fa17c3056d1d4f1d1a7f16a799ff4c7378
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133108
    (cherry picked from commit 49ee1c889665c3539fa9a1c99a865a42fc08ee97)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133051
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index ae797aa978a5..25c8af8b6582 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -912,8 +912,8 @@ bool TIFFReader::ConvertScanline(sal_Int32 nY)
                     if ( nPlanes < 3 )
                     {
                         nRed = GetBits( getMapData(0), ( nx * nSamplesPerPixel 
+ 0 ) * nBitsPerSample, nBitsPerSample );
-                        nGreen = GetBits( getMapData(1), ( nx * 
nSamplesPerPixel + 1 ) * nBitsPerSample, nBitsPerSample );
-                        nBlue = GetBits( getMapData(2), ( nx * 
nSamplesPerPixel + 2 ) * nBitsPerSample, nBitsPerSample );
+                        nGreen = GetBits( getMapData(0), ( nx * 
nSamplesPerPixel + 1 ) * nBitsPerSample, nBitsPerSample );
+                        nBlue = GetBits( getMapData(0), ( nx * 
nSamplesPerPixel + 2 ) * nBitsPerSample, nBitsPerSample );
                     }
                     else
                     {

Reply via email to