summaryrefslogtreecommitdiff
path: root/filter/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-22 15:06:10 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-08-22 23:31:38 +0000
commit69480705d9785296888a5543781d963bdab39a1c (patch)
treea9015fb09abc0c88713214279d6c8af63c52e03a /filter/source
parent55638b9f72beeebde6887d620ce1513bbda7e506 (diff)
Resolves: fdo#68275 Grayscale TIFF is imported as white
this reverts 6c719c1585eb1a2dbab86cc73ff871da41765981 "n#615223 local nbyte1 should have been class-level nByte1" which was to fix the use seen in valgrind og the uninitialized nByte1 So additionally remove the use of the uninit nByte1 entirely Change-Id: I5b3f4fa00d74e545f207a11a5e90935f14a23a8e (cherry picked from commit 98a61a2ae109f3d72940274ceafcf3e84d79aa0b) Reviewed-on: https://gerrit.libreoffice.org/5585 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'filter/source')
-rw-r--r--filter/source/graphicfilter/itiff/itiff.cxx20
1 files changed, 6 insertions, 14 deletions
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 961acdd1ba98..21d7b3b98b5f 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -63,7 +63,6 @@ private:
sal_uInt16 nDataType;
// Daten, die aus dem TIFF-Tags entnommen werden:
sal_Bool bByteSwap; // sal_True if bits 0..7 -> 7..0 should get converted ( FILLORDER = 2 );
- sal_uInt8 nByte1; // 'I', if the format is LittleEndian
sal_uLong nNewSubFile; //
sal_uLong nSubFile; //
@@ -125,12 +124,7 @@ private:
bool HasAlphaChannel() const;
public:
- TIFFReader()
- : pAlphaMask(0)
- , pMaskAcc(0)
- , nByte1(0)
- {
- }
+ TIFFReader() : pAlphaMask(0), pMaskAcc(0) {}
~TIFFReader()
{
delete pAlphaMask;
@@ -1020,8 +1014,6 @@ sal_Bool TIFFReader::ConvertScanline( sal_uLong nY )
{
sal_uLong nMinMax = ( ( 1 << 8 /*nDstBitsPerPixel*/ ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
sal_uInt8* pt = pMap[ 0 ];
- if ( nByte1 == 'I' )
- pt++;
for ( nx = 0; nx < nImageWidth; nx++, pt += 2 )
{
pAcc->SetPixel( nY, nx, (sal_uInt8)( ( (sal_uLong)*pt - nMinSampleValue ) * nMinMax ) );
@@ -1088,17 +1080,17 @@ void TIFFReader::MakePalCol( void )
void TIFFReader::ReadHeader()
{
- sal_uInt8 nbyte2(0);
- sal_uInt16 nushort(0);
+ sal_uInt8 nbyte1, nbyte2;
+ sal_uInt16 nushort;
- *pTIFF >> nByte1;
- if ( nByte1 == 'I' )
+ *pTIFF >> nbyte1;
+ if ( nbyte1 == 'I' )
pTIFF->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
else
pTIFF->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
*pTIFF >> nbyte2 >> nushort;
- if ( nByte1 != nbyte2 || ( nByte1 != 'I' && nByte1 != 'M' ) || nushort != 0x002a )
+ if ( nbyte1 != nbyte2 || ( nbyte1 != 'I' && nbyte1 != 'M' ) || nushort != 0x002a )
bStatus = sal_False;
}