diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-06-03 23:50:14 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-06-06 14:49:31 +0200 |
commit | da4f7d5d76e054627b61521657d40141b9728e15 (patch) | |
tree | facd078a3419685e85e30f3af4335416cd5a94c6 /filter | |
parent | lotuswordpro: fix some endian issues (diff) | |
download | core-da4f7d5d76e054627b61521657d40141b9728e15.tar.gz core-da4f7d5d76e054627b61521657d40141b9728e15.zip |
filter: "tga" import: fix some endian issues in ImplReadPalette
Change-Id: Ia8ec7b7e19cf9b6b19497cbd77ae5a4e2fdccee7
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/graphicfilter/itga/itga.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx index 20a90061e4f5..6bf858c9e351 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; |