[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - filter/source

Michael Stahl mstahl at redhat.com
Tue Jun 7 07:30:32 UTC 2016


 filter/source/graphicfilter/itga/itga.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit a895d9868a637bf2a3c2ffd8d26828c99ea8f40f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jun 3 23:50:14 2016 +0200

    filter: "tga" import: fix some endian issues in ImplReadPalette
    
    Change-Id: Ia8ec7b7e19cf9b6b19497cbd77ae5a4e2fdccee7
    (cherry picked from commit da4f7d5d76e054627b61521657d40141b9728e15)
    Reviewed-on: https://gerrit.libreoffice.org/25993
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx
index 20a9006..6bf858c 100644
--- a/filter/source/graphicfilter/itga/itga.cxx
+++ b/filter/source/graphicfilter/itga/itga.cxx
@@ -734,14 +734,21 @@ bool TGAReader::ImplReadPalette()
                 break;
 
             case 32 :
-                m_rTGA.Read( mpColorMap, 4 * nColors );
+                for (sal_uInt16 i = 0; i < nColors; i++)
+                {
+                    m_rTGA.ReadUInt32(mpColorMap[i]);
+                }
                 break;
 
             case 24 :
                 {
                     for ( sal_uLong i = 0; i < nColors; i++ )
                     {
-                        m_rTGA.Read( &mpColorMap[ i ], 3 );
+                        sal_uInt8 nBlue;
+                        sal_uInt8 nGreen;
+                        sal_uInt8 nRed;
+                        m_rTGA.ReadUChar(nBlue).ReadUChar(nGreen).ReadUChar(nRed);
+                        mpColorMap[i] = (nRed << 16) | (nGreen << 8) | nBlue;
                     }
                 }
                 break;


More information about the Libreoffice-commits mailing list