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

Caolán McNamara caolanm at redhat.com
Thu Apr 17 22:03:48 PDT 2014


 filter/source/graphicfilter/ipcx/ipcx.cxx      |    9 +-
 filter/source/graphicfilter/itiff/itiff.cxx    |   80 ++++++++++++++++++++-----
 filter/source/graphicfilter/itiff/lzwdecom.cxx |   14 +++-
 3 files changed, 80 insertions(+), 23 deletions(-)

New commits:
commit 15494c3dc504c693bd84a6217498f6bf17411855
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 17 11:58:38 2014 +0100

    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 at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx
index 54579ff..2d35844 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 71bd7e0..71bad87 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 4ac9d4c..00e7a33 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;
 }
 
 


More information about the Libreoffice-commits mailing list