summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-04-17 11:58:38 +0100
committerAndras Timar <andras.timar@collabora.com>2014-04-22 09:40:42 +0200
commit89ec126493272afc48be2cf6a27787ba331205fd (patch)
tree54461da9f64632b9d8b4af64a2ff258a3f1625fc /filter
parent13b913adbd15da416f11bf7c49fd3fbe5be956f0 (diff)
zero various members
(cherry picked from commit 9de20d1eb046f7bb92d893408206b91a9c054e2e) Conflicts: filter/Module_filter.mk filter/source/graphicfilter/ipcx/ipcx.cxx filter/source/graphicfilter/itiff/itiff.cxx Change-Id: Iad6948fdf6eb60f86d764783b72a4fe7f5642e40 Reviewed-on: https://gerrit.libreoffice.org/9082 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/ipcx/ipcx.cxx9
-rw-r--r--filter/source/graphicfilter/itiff/itiff.cxx80
-rw-r--r--filter/source/graphicfilter/itiff/lzwdecom.cxx14
3 files changed, 80 insertions, 23 deletions
diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx
index 54579ff0aa74..2d35844b24e8 100644
--- a/filter/source/graphicfilter/ipcx/ipcx.cxx
+++ b/filter/source/graphicfilter/ipcx/ipcx.cxx
@@ -148,10 +148,7 @@ sal_Bool PCXReader::ReadPCX(Graphic & rGraphic)
void PCXReader::ImplReadHeader()
{
- sal_uInt8 nbyte;
- sal_uInt16 nushort;
- sal_uInt16 nMinX,nMinY,nMaxX,nMaxY;
-
+ sal_uInt8 nbyte(0);
m_rPCX >> nbyte >> nVersion >> nEncoding;
if ( nbyte!=0x0a || (nVersion != 0 && nVersion != 2 && nVersion != 3 && nVersion != 5) || nEncoding > 1 )
{
@@ -159,7 +156,9 @@ void PCXReader::ImplReadHeader()
return;
}
+ nbyte = 0;
m_rPCX >> nbyte; nBitsPerPlanePix = (sal_uLong)nbyte;
+ sal_uInt16 nMinX(0),nMinY(0),nMaxX(0),nMaxY(0);
m_rPCX >> nMinX >> nMinY >> nMaxX >> nMaxY;
if ((nMinX > nMaxX) || (nMinY > nMaxY))
@@ -179,7 +178,9 @@ void PCXReader::ImplReadHeader()
ImplReadPalette( 16 );
m_rPCX.SeekRel( 1 );
+ nbyte = 0;
m_rPCX >> nbyte; nPlanes = (sal_uLong)nbyte;
+ sal_uInt16 nushort(0);
m_rPCX >> nushort; nBytesPerPlaneLin = (sal_uLong)nushort;
m_rPCX >> nPaletteInfo;
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 71bd7e027e81..71bad87d44d9 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -125,7 +125,54 @@ private:
bool HasAlphaChannel() const;
public:
- TIFFReader() : pAlphaMask(0), pMaskAcc(0) {}
+ TIFFReader()
+ : bStatus(false)
+ , nLastPercent(0)
+ , pTIFF(NULL)
+ , pAcc(NULL)
+ , nDstBitsPerPixel(0)
+ , pAlphaMask(NULL)
+ , pMaskAcc(NULL)
+ , nOrigPos(0)
+ , nOrigNumberFormat(0)
+ , nDataType(0)
+ , bByteSwap(false)
+ , nNewSubFile(0)
+ , nSubFile(0)
+ , nImageWidth(0)
+ , nImageLength(0)
+ , nBitsPerSample(1)
+ , nCompression(1)
+ , nPhotometricInterpretation(0)
+ , nThresholding(1)
+ , nCellWidth(1)
+ , nCellLength(1)
+ , nFillOrder(1)
+ , pStripOffsets(NULL)
+ , nNumStripOffsets(0)
+ , nOrientation(1)
+ , nSamplesPerPixel(1)
+ , nRowsPerStrip(0xffffffff)
+ , pStripByteCounts(NULL)
+ , nNumStripByteCounts(0)
+ , nMinSampleValue(0)
+ , nMaxSampleValue(0)
+ , fXResolution(0.0)
+ , fYResolution(0.0)
+ , nPlanarConfiguration(1)
+ , nGroup3Options(0)
+ , nGroup4Options(0)
+ , nResolutionUnit(2)
+ , nPredictor(0)
+ , pColorMap(NULL)
+ , nNumColors(0)
+ , nPlanes(0)
+ , nStripsPerPlane(0)
+ , nBytesPerRow(0)
+ {
+ pMap[ 0 ] = pMap[ 1 ] = pMap[ 2 ] = pMap[ 3 ] = NULL;
+ }
+
~TIFFReader()
{
delete pAlphaMask;
@@ -178,14 +225,14 @@ sal_uLong TIFFReader::DataTypeSize()
sal_uLong TIFFReader::ReadIntData()
{
- double nDOUBLE;
- float nFLOAT;
- sal_uInt32 nUINT32a, nUINT32b;
- sal_Int32 nINT32;
- sal_uInt16 nUINT16;
- sal_Int16 nINT16;
- sal_uInt8 nBYTE;
- char nCHAR;
+ double nDOUBLE(0.0);
+ float nFLOAT(0);
+ sal_uInt32 nUINT32a(0), nUINT32b(0);
+ sal_Int32 nINT32(0);
+ sal_uInt16 nUINT16(0);
+ sal_Int16 nINT16(0);
+ sal_uInt8 nBYTE(0);
+ char nCHAR(0);
switch( nDataType )
{
@@ -241,13 +288,14 @@ sal_uLong TIFFReader::ReadIntData()
double TIFFReader::ReadDoubleData()
{
- sal_uInt32 nulong;
double nd;
if ( nDataType == 5 )
{
+ sal_uInt32 nulong(0);
*pTIFF >> nulong;
nd = (double)nulong;
+ nulong = 0;
*pTIFF >> nulong;
if ( nulong != 0 )
nd /= (double)nulong;
@@ -603,7 +651,7 @@ sal_Bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent )
else if ( nCompression == 32773 )
{
sal_uLong nStrip,nRecCount,nRowBytesLeft,ny,np,i;
- sal_uInt8 * pdst, nRecHeader, nRecData;
+ sal_uInt8 * pdst;
nStrip = 0;
if ( nStrip >= nNumStripOffsets )
return sal_False;
@@ -623,6 +671,7 @@ sal_Bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent )
pdst=pMap[ np ];
do
{
+ sal_uInt8 nRecHeader(0);
*pTIFF >> nRecHeader;
if ((nRecHeader&0x80)==0)
{
@@ -644,6 +693,7 @@ sal_Bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent )
// return;
}
+ sal_uInt8 nRecData(0);
*pTIFF >> nRecData;
for ( i = 0; i < nRecCount; i++ )
*(pdst++) = nRecData;
@@ -1081,8 +1131,8 @@ void TIFFReader::MakePalCol( void )
void TIFFReader::ReadHeader()
{
- sal_uInt8 nbyte1, nbyte2;
- sal_uInt16 nushort;
+ sal_uInt8 nbyte1(0), nbyte2(0);
+ sal_uInt16 nushort(0);
*pTIFF >> nbyte1;
if ( nbyte1 == 'I' )
@@ -1111,10 +1161,10 @@ bool TIFFReader::HasAlphaChannel() const
sal_Bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
{
- sal_uInt16 i, nNumTags, nTagType;
+ sal_uInt16 i, nNumTags(0), nTagType(0);
sal_uLong nMaxPos;
sal_uLong nPos;
- sal_uInt32 nFirstIfd, nDataLen;
+ sal_uInt32 nFirstIfd(0), nDataLen;
bStatus = sal_True;
nLastPercent = 0;
diff --git a/filter/source/graphicfilter/itiff/lzwdecom.cxx b/filter/source/graphicfilter/itiff/lzwdecom.cxx
index 4ac9d4cf0dcb..00e7a33c0cfc 100644
--- a/filter/source/graphicfilter/itiff/lzwdecom.cxx
+++ b/filter/source/graphicfilter/itiff/lzwdecom.cxx
@@ -23,7 +23,16 @@
#define MAX_TABLE_SIZE 4096
LZWDecompressor::LZWDecompressor()
- : pOutBufData(NULL)
+ : pIStream(NULL)
+ , nTableSize(0)
+ , bEOIFound(false)
+ , bInvert(false)
+ , bFirst(true)
+ , nOldCode(0)
+ , pOutBufData(NULL)
+ , nOutBufDataLen(0)
+ , nInputBitsBuf(0)
+ , nInputBitsBufSize(0)
{
sal_uInt16 i;
@@ -35,9 +44,6 @@ LZWDecompressor::LZWDecompressor()
pTable[i].nDataCount=1;
pTable[i].nData=(sal_uInt8)i;
}
- pIStream=NULL;
- bFirst = sal_True;
- nOldCode = 0;
}