Resolves: fdo#68275 Grayscale TIFF is imported as white
this reverts 6c719c1585
"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
This commit is contained in:
@@ -63,7 +63,6 @@ private:
|
|||||||
sal_uInt16 nDataType;
|
sal_uInt16 nDataType;
|
||||||
// Data taken from the TIFF tags:
|
// Data taken from the TIFF tags:
|
||||||
sal_Bool bByteSwap; // sal_True if bits 0..7 -> 7..0 should get converted ( FILLORDER = 2 );
|
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 nNewSubFile; //
|
||||||
sal_uLong nSubFile; //
|
sal_uLong nSubFile; //
|
||||||
@@ -126,12 +125,7 @@ private:
|
|||||||
bool HasAlphaChannel() const;
|
bool HasAlphaChannel() const;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TIFFReader()
|
TIFFReader() : pAlphaMask(0), pMaskAcc(0) {}
|
||||||
: pAlphaMask(0)
|
|
||||||
, pMaskAcc(0)
|
|
||||||
, nByte1(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
~TIFFReader()
|
~TIFFReader()
|
||||||
{
|
{
|
||||||
delete pAlphaMask;
|
delete pAlphaMask;
|
||||||
@@ -1021,8 +1015,6 @@ sal_Bool TIFFReader::ConvertScanline( sal_uLong nY )
|
|||||||
{
|
{
|
||||||
sal_uLong nMinMax = ( ( 1 << 8 /*nDstBitsPerPixel*/ ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
|
sal_uLong nMinMax = ( ( 1 << 8 /*nDstBitsPerPixel*/ ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
|
||||||
sal_uInt8* pt = pMap[ 0 ];
|
sal_uInt8* pt = pMap[ 0 ];
|
||||||
if ( nByte1 == 'I' )
|
|
||||||
pt++;
|
|
||||||
for ( nx = 0; nx < nImageWidth; nx++, pt += 2 )
|
for ( nx = 0; nx < nImageWidth; nx++, pt += 2 )
|
||||||
{
|
{
|
||||||
pAcc->SetPixelIndex( nY, nx, static_cast<sal_uInt8>( ((sal_uLong)*pt - nMinSampleValue) * nMinMax) );
|
pAcc->SetPixelIndex( nY, nx, static_cast<sal_uInt8>( ((sal_uLong)*pt - nMinSampleValue) * nMinMax) );
|
||||||
@@ -1089,17 +1081,17 @@ void TIFFReader::MakePalCol( void )
|
|||||||
|
|
||||||
void TIFFReader::ReadHeader()
|
void TIFFReader::ReadHeader()
|
||||||
{
|
{
|
||||||
sal_uInt8 nbyte2(0);
|
sal_uInt8 nbyte1, nbyte2;
|
||||||
sal_uInt16 nushort(0);
|
sal_uInt16 nushort;
|
||||||
|
|
||||||
*pTIFF >> nByte1;
|
*pTIFF >> nbyte1;
|
||||||
if ( nByte1 == 'I' )
|
if ( nbyte1 == 'I' )
|
||||||
pTIFF->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
|
pTIFF->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
|
||||||
else
|
else
|
||||||
pTIFF->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
|
pTIFF->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
|
||||||
|
|
||||||
*pTIFF >> nbyte2 >> nushort;
|
*pTIFF >> nbyte2 >> nushort;
|
||||||
if ( nByte1 != nbyte2 || ( nByte1 != 'I' && nByte1 != 'M' ) || nushort != 0x002a )
|
if ( nbyte1 != nbyte2 || ( nbyte1 != 'I' && nbyte1 != 'M' ) || nushort != 0x002a )
|
||||||
bStatus = sal_False;
|
bStatus = sal_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user